diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 438171c2..515e235b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,14 +1,77 @@ -# For more information do to https://github.com/Kentico/Home/wiki/CI-and-Automation-Guidelines - -name: "Build" # Represents the name of the whole action. -on: # Specifies the section where we describe our build triggers. - push: # The action runs with push. - pull_request: # The action runs with a pull request. - schedule: # Specifies the section where we describe the schedule of running the action. - - cron: '0 18 * * 1' # The CRON expression describes when to run the action. -jobs: # Specifies the section where we describe our jobs. - Build: # Specific job section. - runs-on: ubuntu-latest # Describes the environment. - steps: # Specifies the section where we describe the job's steps. - - name: Output some string - run: echo "Set some actual CI steps" \ No newline at end of file +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 \ No newline at end of file diff --git a/KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs b/KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs index e69ea8a2..43dd3387 100644 --- a/KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs +++ b/KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs @@ -1,73 +1,76 @@ -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; -} +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 diff --git a/KVA/Migration.Toolkit.Source/Behaviors/CommandConstraintBehavior.cs b/KVA/Migration.Toolkit.Source/Behaviors/CommandConstraintBehavior.cs index 36fb4e63..fd533131 100644 --- a/KVA/Migration.Toolkit.Source/Behaviors/CommandConstraintBehavior.cs +++ b/KVA/Migration.Toolkit.Source/Behaviors/CommandConstraintBehavior.cs @@ -1,283 +1,283 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Behaviors/RequestHandlingBehavior.cs b/KVA/Migration.Toolkit.Source/Behaviors/RequestHandlingBehavior.cs index a7d4c3b6..682c3455 100644 --- a/KVA/Migration.Toolkit.Source/Behaviors/RequestHandlingBehavior.cs +++ b/KVA/Migration.Toolkit.Source/Behaviors/RequestHandlingBehavior.cs @@ -1,37 +1,37 @@ -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); - } - } +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 diff --git a/KVA/Migration.Toolkit.Source/Behaviors/XbKApiContextBehavior.cs b/KVA/Migration.Toolkit.Source/Behaviors/XbKApiContextBehavior.cs index 2288c495..ed204f12 100644 --- a/KVA/Migration.Toolkit.Source/Behaviors/XbKApiContextBehavior.cs +++ b/KVA/Migration.Toolkit.Source/Behaviors/XbKApiContextBehavior.cs @@ -1,39 +1,39 @@ -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(); - } - } +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 diff --git a/KVA/Migration.Toolkit.Source/Contexts/PrimaryKeyMappingContext.cs b/KVA/Migration.Toolkit.Source/Contexts/PrimaryKeyMappingContext.cs index 7149f318..e4a8245f 100644 --- a/KVA/Migration.Toolkit.Source/Contexts/PrimaryKeyMappingContext.cs +++ b/KVA/Migration.Toolkit.Source/Contexts/PrimaryKeyMappingContext.cs @@ -1,286 +1,286 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Contexts/SourceInstanceContext.cs b/KVA/Migration.Toolkit.Source/Contexts/SourceInstanceContext.cs index 1f7a8599..8da61af3 100644 --- a/KVA/Migration.Toolkit.Source/Contexts/SourceInstanceContext.cs +++ b/KVA/Migration.Toolkit.Source/Contexts/SourceInstanceContext.cs @@ -1,100 +1,100 @@ -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}'"); - } +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 diff --git a/KVA/Migration.Toolkit.Source/Exceptions.cs b/KVA/Migration.Toolkit.Source/Exceptions.cs index 2694f3e2..a8a26ddc 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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Extensions.cs b/KVA/Migration.Toolkit.Source/Extensions.cs index b6055b77..12a4d3c3 100644 --- a/KVA/Migration.Toolkit.Source/Extensions.cs +++ b/KVA/Migration.Toolkit.Source/Extensions.cs @@ -1,38 +1,38 @@ -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"); - } - } +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 diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateAttachmentsCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateAttachmentsCommandHandler.cs index c8fbb865..e248c428 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateAttachmentsCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigrateAttachmentsCommandHandler.cs @@ -1,34 +1,34 @@ -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(); - } +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 diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateCategoriesCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateCategoriesCommandHandler.cs index ac2829ec..8df9fa1e 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateCategoriesCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigrateCategoriesCommandHandler.cs @@ -1,191 +1,191 @@ -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}\"]" } - } - }); - } +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 diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomModulesCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomModulesCommandHandler.cs index f3fa9fb2..7f08277f 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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomTablesHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomTablesHandler.cs index 7cffed8e..04e9469c 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomTablesHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomTablesHandler.cs @@ -1,205 +1,205 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateFormsCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateFormsCommandHandler.cs index 9fca8837..de3600e9 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateFormsCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigrateFormsCommandHandler.cs @@ -1,263 +1,263 @@ -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(); - } +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 diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigratePageTypesCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigratePageTypesCommandHandler.cs index 78fa2bdc..012e6d32 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigratePageTypesCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigratePageTypesCommandHandler.cs @@ -1,168 +1,168 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigratePagesCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigratePagesCommandHandler.cs index 6232df04..d64e9eb6 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigratePagesCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigratePagesCommandHandler.cs @@ -1,689 +1,689 @@ -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 +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 diff --git a/KVA/Migration.Toolkit.Source/Helpers/KenticoHelper.cs b/KVA/Migration.Toolkit.Source/Helpers/KenticoHelper.cs index 283402af..5197ae1e 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)); - } - } +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 diff --git a/KVA/Migration.Toolkit.Source/Helpers/PageBuilderWidgetsPatcher.cs b/KVA/Migration.Toolkit.Source/Helpers/PageBuilderWidgetsPatcher.cs index 3d9612f1..5304fb83 100644 --- a/KVA/Migration.Toolkit.Source/Helpers/PageBuilderWidgetsPatcher.cs +++ b/KVA/Migration.Toolkit.Source/Helpers/PageBuilderWidgetsPatcher.cs @@ -1,70 +1,70 @@ -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; - } - } - } - } - } +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 diff --git a/KVA/Migration.Toolkit.Source/Helpers/PrintHelper.cs b/KVA/Migration.Toolkit.Source/Helpers/PrintHelper.cs index e1928c73..67451839 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 ?? ""}")); +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 diff --git a/KVA/Migration.Toolkit.Source/Helpers/Printer.cs b/KVA/Migration.Toolkit.Source/Helpers/Printer.cs index 3f477ca5..20619dd2 100644 --- a/KVA/Migration.Toolkit.Source/Helpers/Printer.cs +++ b/KVA/Migration.Toolkit.Source/Helpers/Printer.cs @@ -1,122 +1,123 @@ -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); - } +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 diff --git a/KVA/Migration.Toolkit.Source/ISourceModel.cs b/KVA/Migration.Toolkit.Source/ISourceModel.cs index 862164d7..046b55e5 100644 --- a/KVA/Migration.Toolkit.Source/ISourceModel.cs +++ b/KVA/Migration.Toolkit.Source/ISourceModel.cs @@ -1,13 +1,13 @@ -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); +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 diff --git a/KVA/Migration.Toolkit.Source/KsCoreDiExtensions.cs b/KVA/Migration.Toolkit.Source/KsCoreDiExtensions.cs index 535844cf..6fae5c11 100644 --- a/KVA/Migration.Toolkit.Source/KsCoreDiExtensions.cs +++ b/KVA/Migration.Toolkit.Source/KsCoreDiExtensions.cs @@ -1,115 +1,115 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Mappers/AlternativeFormMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/AlternativeFormMapper.cs index 229e2455..ac698869 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/AlternativeFormMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/AlternativeFormMapper.cs @@ -1,98 +1,98 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Mappers/CmsAttachmentMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/CmsAttachmentMapper.cs index c5f3338a..69196f7a 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 LegacyOriginalPath = "__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(LegacyOriginalPath, attachmentNode.NodeAliasPath); - } - - return target; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Mappers/CmsClassMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/CmsClassMapper.cs index 12523f36..a1569ef6 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/CmsClassMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/CmsClassMapper.cs @@ -1,361 +1,361 @@ -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 RequiredRuleIdentifier = "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: RequiredRuleIdentifier })) - { - 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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Mappers/CmsFormMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/CmsFormMapper.cs index 188ae2b6..fdf498fb 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/CmsFormMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/CmsFormMapper.cs @@ -1,123 +1,123 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs index 6f96e59c..7da7f2d8 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs @@ -1,836 +1,839 @@ -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) - .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()); - } - } +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) + .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 diff --git a/KVA/Migration.Toolkit.Source/Mappers/MemberInfoMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/MemberInfoMapper.cs index fd40056f..937e5adb 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/MemberInfoMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/MemberInfoMapper.cs @@ -1,177 +1,177 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs index d18d9687..290d6e3b 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs @@ -1,229 +1,229 @@ -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 +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 diff --git a/KVA/Migration.Toolkit.Source/Mappers/ResourceMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/ResourceMapper.cs index bd1d85c3..ed7befe7 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/ResourceMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/ResourceMapper.cs @@ -1,46 +1,46 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Mappers/TagMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/TagMapper.cs index 1e3a7b7f..aa6889e2 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/TagMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/TagMapper.cs @@ -1,39 +1,39 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeForm.cs b/KVA/Migration.Toolkit.Source/Model/CmsAlternativeForm.cs index 09c85f83..0d336e96 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeForm.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsAlternativeForm.cs @@ -1,114 +1,113 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeUrl.cs b/KVA/Migration.Toolkit.Source/Model/CmsAlternativeUrl.cs index d554cda6..ea29820e 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeUrl.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsAlternativeUrl.cs @@ -1,101 +1,100 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsAttachment.cs b/KVA/Migration.Toolkit.Source/Model/CmsAttachment.cs index 5fac89dc..f5ddd466 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsAttachment.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsAttachment.cs @@ -1,123 +1,122 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsCategory.cs b/KVA/Migration.Toolkit.Source/Model/CmsCategory.cs index 54f83d02..a7e848ef 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsCategory.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsCategory.cs @@ -1,115 +1,114 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsClass.cs b/KVA/Migration.Toolkit.Source/Model/CmsClass.cs index 2baa2a51..0b9715eb 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsClass.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsClass.cs @@ -1,146 +1,145 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsClassSite.cs b/KVA/Migration.Toolkit.Source/Model/CmsClassSite.cs index b121771f..c320449c 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsClassSite.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsClassSite.cs @@ -1,102 +1,101 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsConsent.cs b/KVA/Migration.Toolkit.Source/Model/CmsConsent.cs index 10b3bd4f..8a6814a9 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsConsent.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsConsent.cs @@ -1,107 +1,106 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsConsentAgreement.cs b/KVA/Migration.Toolkit.Source/Model/CmsConsentAgreement.cs index bb432753..c8c49113 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsConsentAgreement.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsConsentAgreement.cs @@ -1,107 +1,106 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsConsentArchive.cs b/KVA/Migration.Toolkit.Source/Model/CmsConsentArchive.cs index 516f5e82..e016956b 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsConsentArchive.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsConsentArchive.cs @@ -1,106 +1,105 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsCountry.cs b/KVA/Migration.Toolkit.Source/Model/CmsCountry.cs index f66c73a3..e9b7b4f6 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsCountry.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsCountry.cs @@ -1,107 +1,106 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsCulture.cs b/KVA/Migration.Toolkit.Source/Model/CmsCulture.cs index a7cc514b..06ec8a19 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsCulture.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsCulture.cs @@ -1,108 +1,107 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsDocument.cs b/KVA/Migration.Toolkit.Source/Model/CmsDocument.cs index 8b908f16..ccf5d39e 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsDocument.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsDocument.cs @@ -1,135 +1,134 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsDocumentCategory.cs b/KVA/Migration.Toolkit.Source/Model/CmsDocumentCategory.cs index 44edb960..a52ece25 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsDocumentCategory.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsDocumentCategory.cs @@ -1,102 +1,101 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsForm.cs b/KVA/Migration.Toolkit.Source/Model/CmsForm.cs index a065fece..9d5d575c 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsForm.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsForm.cs @@ -1,124 +1,123 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsFormUserControl.cs b/KVA/Migration.Toolkit.Source/Model/CmsFormUserControl.cs index 3ef8c892..12be0d34 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsFormUserControl.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsFormUserControl.cs @@ -1,130 +1,129 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsPageFormerUrlPath.cs b/KVA/Migration.Toolkit.Source/Model/CmsPageFormerUrlPath.cs index 3f432653..9c94d3a7 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsPageFormerUrlPath.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsPageFormerUrlPath.cs @@ -1,101 +1,100 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsPageTemplateConfiguration.cs b/KVA/Migration.Toolkit.Source/Model/CmsPageTemplateConfiguration.cs index 4e9a7427..83e87292 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsPageTemplateConfiguration.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsPageTemplateConfiguration.cs @@ -1,101 +1,100 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsPageUrlPath.cs b/KVA/Migration.Toolkit.Source/Model/CmsPageUrlPath.cs index 42a3ab1d..648da2f2 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsPageUrlPath.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsPageUrlPath.cs @@ -1,101 +1,100 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsRelationship.cs b/KVA/Migration.Toolkit.Source/Model/CmsRelationship.cs index 759c318a..0372e18f 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsRelationship.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsRelationship.cs @@ -1,107 +1,106 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsResource.cs b/KVA/Migration.Toolkit.Source/Model/CmsResource.cs index a2002173..836b67af 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsResource.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsResource.cs @@ -1,114 +1,113 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsRole.cs b/KVA/Migration.Toolkit.Source/Model/CmsRole.cs index 58f0cebf..3cacf2f0 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsRole.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsRole.cs @@ -1,108 +1,107 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsSettingsKey.cs b/KVA/Migration.Toolkit.Source/Model/CmsSettingsKey.cs index 7c276059..ae5ffbbb 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsSettingsKey.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsSettingsKey.cs @@ -1,119 +1,118 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsSite.cs b/KVA/Migration.Toolkit.Source/Model/CmsSite.cs index 41d1c278..673426bc 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsSite.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsSite.cs @@ -1,109 +1,108 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsSiteCulture.cs b/KVA/Migration.Toolkit.Source/Model/CmsSiteCulture.cs index b89900e9..bc7a649e 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsSiteCulture.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsSiteCulture.cs @@ -1,102 +1,101 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsState.cs b/KVA/Migration.Toolkit.Source/Model/CmsState.cs index c7f1a37d..2291c33d 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsState.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsState.cs @@ -1,107 +1,106 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsTree.cs b/KVA/Migration.Toolkit.Source/Model/CmsTree.cs index 66c0737a..202704b9 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsTree.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsTree.cs @@ -1,121 +1,120 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsUser.cs b/KVA/Migration.Toolkit.Source/Model/CmsUser.cs index 7e222335..0c855150 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsUser.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsUser.cs @@ -1,127 +1,126 @@ -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, string? CustomizedField1): 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"), reader.Unbox("CustomizedField1") - ); - } - 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"), reader.Unbox("CustomizedField1") - ); - } -}; - +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, string? CustomizedField1) : 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"), reader.Unbox("CustomizedField1") + ); + } + 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"), reader.Unbox("CustomizedField1") + ); + } +}; \ No newline at end of file diff --git a/KVA/Migration.Toolkit.Source/Model/CmsUserSetting.cs b/KVA/Migration.Toolkit.Source/Model/CmsUserSetting.cs index 5ace46ab..5d3f60a7 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsUserSetting.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsUserSetting.cs @@ -1,132 +1,131 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/CmsVersionHistory.cs b/KVA/Migration.Toolkit.Source/Model/CmsVersionHistory.cs index 6f4f5a0a..df1a24aa 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsVersionHistory.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsVersionHistory.cs @@ -1,120 +1,119 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/OmActivity.cs b/KVA/Migration.Toolkit.Source/Model/OmActivity.cs index 870fb4d0..26c65c32 100644 --- a/KVA/Migration.Toolkit.Source/Model/OmActivity.cs +++ b/KVA/Migration.Toolkit.Source/Model/OmActivity.cs @@ -1,119 +1,118 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/OmContact.cs b/KVA/Migration.Toolkit.Source/Model/OmContact.cs index 087f1707..f1dbb7bb 100644 --- a/KVA/Migration.Toolkit.Source/Model/OmContact.cs +++ b/KVA/Migration.Toolkit.Source/Model/OmContact.cs @@ -1,131 +1,130 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/Model/OmContactStatus.cs b/KVA/Migration.Toolkit.Source/Model/OmContactStatus.cs index 13fc38f0..8a3a66ec 100644 --- a/KVA/Migration.Toolkit.Source/Model/OmContactStatus.cs +++ b/KVA/Migration.Toolkit.Source/Model/OmContactStatus.cs @@ -1,104 +1,103 @@ -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") - ); - } -}; - +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 diff --git a/KVA/Migration.Toolkit.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs b/KVA/Migration.Toolkit.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs index 806a2c31..4f8591b9 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; - +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 diff --git a/KVA/Migration.Toolkit.Source/ModelFacade.cs b/KVA/Migration.Toolkit.Source/ModelFacade.cs index df674485..92310f43 100644 --- a/KVA/Migration.Toolkit.Source/ModelFacade.cs +++ b/KVA/Migration.Toolkit.Source/ModelFacade.cs @@ -1,195 +1,195 @@ -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}'"); - } +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 diff --git a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameProvider.cs b/KVA/Migration.Toolkit.Source/Providers/ContentItemNameProvider.cs index 5f2fc8ab..a67593e9 100644 --- a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameProvider.cs +++ b/KVA/Migration.Toolkit.Source/Providers/ContentItemNameProvider.cs @@ -1,47 +1,47 @@ -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); - } +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 diff --git a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameValidator.cs b/KVA/Migration.Toolkit.Source/Providers/ContentItemNameValidator.cs index c8edd722..7c76bc72 100644 --- a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameValidator.cs +++ b/KVA/Migration.Toolkit.Source/Providers/ContentItemNameValidator.cs @@ -1,25 +1,25 @@ -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(); - } +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 diff --git a/KVA/Migration.Toolkit.Source/Providers/UniqueContentItemNameProvider.cs b/KVA/Migration.Toolkit.Source/Providers/UniqueContentItemNameProvider.cs index a3a4e748..cfb0e000 100644 --- a/KVA/Migration.Toolkit.Source/Providers/UniqueContentItemNameProvider.cs +++ b/KVA/Migration.Toolkit.Source/Providers/UniqueContentItemNameProvider.cs @@ -1,48 +1,48 @@ -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)); - } +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 diff --git a/KVA/Migration.Toolkit.Source/Services/AttachmentMigrator.cs b/KVA/Migration.Toolkit.Source/Services/AttachmentMigrator.cs index f735ef06..b77520db 100644 --- a/KVA/Migration.Toolkit.Source/Services/AttachmentMigrator.cs +++ b/KVA/Migration.Toolkit.Source/Services/AttachmentMigrator.cs @@ -1,253 +1,257 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Services/ClassService.cs b/KVA/Migration.Toolkit.Source/Services/ClassService.cs index d802ed4f..b238f912 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; - }); - } +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 diff --git a/KVA/Migration.Toolkit.Source/Services/CmsRelationshipService.cs b/KVA/Migration.Toolkit.Source/Services/CmsRelationshipService.cs index 719c12fc..d05af62d 100644 --- a/KVA/Migration.Toolkit.Source/Services/CmsRelationshipService.cs +++ b/KVA/Migration.Toolkit.Source/Services/CmsRelationshipService.cs @@ -1,27 +1,27 @@ -namespace Migration.Toolkit.Source.Services; - -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Source.Model; - -public class CmsRelationshipService( - ILogger logger, - ModelFacade modelFacade) -{ - public record NodeRelationShipResult(ICmsRelationship Relationship, ICmsTree? RightNode); - public IEnumerable GetNodeRelationships(int nodeId) - { - var relationships = modelFacade.SelectWhere("LeftNodeId = @nodeId", new SqlParameter("nodeId", nodeId)); - foreach (var cmsRelationship in relationships) - { - yield return new (cmsRelationship, modelFacade.SelectById(cmsRelationship.RightNodeID)); - } - // foreach (var cmsRelationship in kx13Context.CmsRelationships - // .Include(r => r.RelationshipName) - // .Include(r => r.RightNode) - // .Where(r => r.LeftNodeId == nodeId)) - // { - // yield return cmsRelationship; - // } - } +namespace Migration.Toolkit.Source.Services; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; +using Migration.Toolkit.Source.Model; + +public class CmsRelationshipService( + ILogger logger, + ModelFacade modelFacade) +{ + public record NodeRelationShipResult(ICmsRelationship Relationship, ICmsTree? RightNode); + public IEnumerable GetNodeRelationships(int nodeId) + { + var relationships = modelFacade.SelectWhere("LeftNodeId = @nodeId", new SqlParameter("nodeId", nodeId)); + foreach (var cmsRelationship in relationships) + { + yield return new(cmsRelationship, modelFacade.SelectById(cmsRelationship.RightNodeID)); + } + // foreach (var cmsRelationship in kx13Context.CmsRelationships + // .Include(r => r.RelationshipName) + // .Include(r => r.RightNode) + // .Where(r => r.LeftNodeId == nodeId)) + // { + // yield return cmsRelationship; + // } + } } \ No newline at end of file diff --git a/KVA/Migration.Toolkit.Source/Services/DeferredPathService.cs b/KVA/Migration.Toolkit.Source/Services/DeferredPathService.cs index 0352c5e2..062e447a 100644 --- a/KVA/Migration.Toolkit.Source/Services/DeferredPathService.cs +++ b/KVA/Migration.Toolkit.Source/Services/DeferredPathService.cs @@ -1,18 +1,18 @@ -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)); - } +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 diff --git a/KVA/Migration.Toolkit.Source/Services/IPrimaryKeyLocatorService.cs b/KVA/Migration.Toolkit.Source/Services/IPrimaryKeyLocatorService.cs index bd95d6fa..d0b0d363 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); +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 diff --git a/KVA/Migration.Toolkit.Source/Services/Model/AttachmentSelectorItem.cs b/KVA/Migration.Toolkit.Source/Services/Model/AttachmentSelectorItem.cs index 4d842f2a..d97e8b56 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; } +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 diff --git a/KVA/Migration.Toolkit.Source/Services/Model/EditableAreasConfiguration.cs b/KVA/Migration.Toolkit.Source/Services/Model/EditableAreasConfiguration.cs index ce010efc..038a232a 100644 --- a/KVA/Migration.Toolkit.Source/Services/Model/EditableAreasConfiguration.cs +++ b/KVA/Migration.Toolkit.Source/Services/Model/EditableAreasConfiguration.cs @@ -1,187 +1,186 @@ -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 - +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 diff --git a/KVA/Migration.Toolkit.Source/Services/Model/PageSelectorItem.cs b/KVA/Migration.Toolkit.Source/Services/Model/PageSelectorItem.cs index 7711b333..47846270 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; } +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 diff --git a/KVA/Migration.Toolkit.Source/Services/Model/PageTemplateConfiguration.cs b/KVA/Migration.Toolkit.Source/Services/Model/PageTemplateConfiguration.cs index d896cd9d..c44216ca 100644 --- a/KVA/Migration.Toolkit.Source/Services/Model/PageTemplateConfiguration.cs +++ b/KVA/Migration.Toolkit.Source/Services/Model/PageTemplateConfiguration.cs @@ -1,29 +1,29 @@ -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; } +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 diff --git a/KVA/Migration.Toolkit.Source/Services/ModuleLoader.cs b/KVA/Migration.Toolkit.Source/Services/ModuleLoader.cs index 7388ada2..3154b4b6 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; - } - } +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 diff --git a/KVA/Migration.Toolkit.Source/Services/PageTemplateMigrator.cs b/KVA/Migration.Toolkit.Source/Services/PageTemplateMigrator.cs index c8469570..cb6e4332 100644 --- a/KVA/Migration.Toolkit.Source/Services/PageTemplateMigrator.cs +++ b/KVA/Migration.Toolkit.Source/Services/PageTemplateMigrator.cs @@ -1,54 +1,54 @@ -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; - } - } +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 diff --git a/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs b/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs index 5ecf5904..44afce0b 100644 --- a/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs +++ b/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs @@ -1,249 +1,249 @@ -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; - } +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 diff --git a/KVA/Migration.Toolkit.Source/Services/ReusableSchemaService.cs b/KVA/Migration.Toolkit.Source/Services/ReusableSchemaService.cs index 77fa91e7..e2cdf445 100644 --- a/KVA/Migration.Toolkit.Source/Services/ReusableSchemaService.cs +++ b/KVA/Migration.Toolkit.Source/Services/ReusableSchemaService.cs @@ -1,135 +1,135 @@ -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(".", "_"), ""); +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 diff --git a/Migration.Toolkit.CLI/ConfigurationValidator.cs b/Migration.Toolkit.CLI/ConfigurationValidator.cs index db090b0b..e439370e 100644 --- a/Migration.Toolkit.CLI/ConfigurationValidator.cs +++ b/Migration.Toolkit.CLI/ConfigurationValidator.cs @@ -1,191 +1,191 @@ -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 +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 diff --git a/Migration.Toolkit.CLI/Program.cs b/Migration.Toolkit.CLI/Program.cs index b6bf08f5..4b210530 100644 --- a/Migration.Toolkit.CLI/Program.cs +++ b/Migration.Toolkit.CLI/Program.cs @@ -1,221 +1,221 @@ -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(); +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 diff --git a/Migration.Toolkit.Common/Abstractions/Command.cs b/Migration.Toolkit.Common/Abstractions/Command.cs index a93624e4..eb2c8ff4 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; } +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 diff --git a/Migration.Toolkit.Common/Abstractions/CommandResult.cs b/Migration.Toolkit.Common/Abstractions/CommandResult.cs index ac864af1..77e184b7 100644 --- a/Migration.Toolkit.Common/Abstractions/CommandResult.cs +++ b/Migration.Toolkit.Common/Abstractions/CommandResult.cs @@ -1,7 +1,7 @@ -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; \ No newline at end of file diff --git a/Migration.Toolkit.Common/Abstractions/EntityMapperBase.cs b/Migration.Toolkit.Common/Abstractions/EntityMapperBase.cs index f3f94a93..04b11296 100644 --- a/Migration.Toolkit.Common/Abstractions/EntityMapperBase.cs +++ b/Migration.Toolkit.Common/Abstractions/EntityMapperBase.cs @@ -1,184 +1,184 @@ -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; - } - } +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 diff --git a/Migration.Toolkit.Common/Abstractions/IEntityMapper.cs b/Migration.Toolkit.Common/Abstractions/IEntityMapper.cs index 57067b2c..535efd2a 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); +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 diff --git a/Migration.Toolkit.Common/Abstractions/IModuleLoader.cs b/Migration.Toolkit.Common/Abstractions/IModuleLoader.cs index 9a149cd5..8bc0abe6 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(); +namespace Migration.Toolkit.Common.Abstractions; + +public interface IModuleLoader +{ + Task LoadAsync(); } \ No newline at end of file diff --git a/Migration.Toolkit.Common/Abstractions/ModelMappingResult.cs b/Migration.Toolkit.Common/Abstractions/ModelMappingResult.cs index 94ed84fd..e34c1d18 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); +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 diff --git a/Migration.Toolkit.Common/Abstractions/UmtMapperBase.cs b/Migration.Toolkit.Common/Abstractions/UmtMapperBase.cs index 9ebec950..bce19608 100644 --- a/Migration.Toolkit.Common/Abstractions/UmtMapperBase.cs +++ b/Migration.Toolkit.Common/Abstractions/UmtMapperBase.cs @@ -1,13 +1,13 @@ -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); +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 diff --git a/Migration.Toolkit.Common/Commands.cs b/Migration.Toolkit.Common/Commands.cs index 110b5254..bb8f571a 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 => []; +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 diff --git a/Migration.Toolkit.Common/CommonDiExtensions.cs b/Migration.Toolkit.Common/CommonDiExtensions.cs index 650e3f9b..36380844 100644 --- a/Migration.Toolkit.Common/CommonDiExtensions.cs +++ b/Migration.Toolkit.Common/CommonDiExtensions.cs @@ -1,15 +1,15 @@ -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; - } +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 diff --git a/Migration.Toolkit.Common/ConfigurationNames.cs b/Migration.Toolkit.Common/ConfigurationNames.cs index 72843172..4964e290 100644 --- a/Migration.Toolkit.Common/ConfigurationNames.cs +++ b/Migration.Toolkit.Common/ConfigurationNames.cs @@ -1,65 +1,65 @@ -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]"; +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 diff --git a/Migration.Toolkit.Common/EntityConfiguration.cs b/Migration.Toolkit.Common/EntityConfiguration.cs index 226a2894..3fa1359b 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); +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 diff --git a/Migration.Toolkit.Common/Enumerations/K12SystemClass.cs b/Migration.Toolkit.Common/Enumerations/K12SystemClass.cs index 95168053..c33d9cf7 100644 --- a/Migration.Toolkit.Common/Enumerations/K12SystemClass.cs +++ b/Migration.Toolkit.Common/Enumerations/K12SystemClass.cs @@ -1,355 +1,479 @@ -// 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); +// 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 diff --git a/Migration.Toolkit.Common/Enumerations/K12SystemResource.cs b/Migration.Toolkit.Common/Enumerations/K12SystemResource.cs index ad7ade23..1fa89417 100644 --- a/Migration.Toolkit.Common/Enumerations/K12SystemResource.cs +++ b/Migration.Toolkit.Common/Enumerations/K12SystemResource.cs @@ -1,92 +1,157 @@ -// 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); +// 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 diff --git a/Migration.Toolkit.Common/Enumerations/KsFieldDataType.cs b/Migration.Toolkit.Common/Enumerations/KsFieldDataType.cs index f0deef9f..6d21ea65 100644 --- a/Migration.Toolkit.Common/Enumerations/KsFieldDataType.cs +++ b/Migration.Toolkit.Common/Enumerations/KsFieldDataType.cs @@ -1,50 +1,50 @@ -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"; +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 diff --git a/Migration.Toolkit.Common/Enumerations/Kx13FormControls.cs b/Migration.Toolkit.Common/Enumerations/Kx13FormControls.cs index 5b0ef8c2..8704b9b2 100644 --- a/Migration.Toolkit.Common/Enumerations/Kx13FormControls.cs +++ b/Migration.Toolkit.Common/Enumerations/Kx13FormControls.cs @@ -1,265 +1,265 @@ -// 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"; +// 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 diff --git a/Migration.Toolkit.Common/Enumerations/Kx13SystemClasses.cs b/Migration.Toolkit.Common/Enumerations/Kx13SystemClasses.cs index bd679a1e..18a147fa 100644 --- a/Migration.Toolkit.Common/Enumerations/Kx13SystemClasses.cs +++ b/Migration.Toolkit.Common/Enumerations/Kx13SystemClasses.cs @@ -1,178 +1,178 @@ -// 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); +// 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 diff --git a/Migration.Toolkit.Common/Enumerations/Kx13SystemResource.cs b/Migration.Toolkit.Common/Enumerations/Kx13SystemResource.cs index b692cda9..95c3840f 100644 --- a/Migration.Toolkit.Common/Enumerations/Kx13SystemResource.cs +++ b/Migration.Toolkit.Common/Enumerations/Kx13SystemResource.cs @@ -1,72 +1,72 @@ -// 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); +// 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 diff --git a/Migration.Toolkit.Common/Enumerations/NodeXmlColumns.cs b/Migration.Toolkit.Common/Enumerations/NodeXmlColumns.cs index b8cc4d67..bf43fa7b 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"; +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 diff --git a/Migration.Toolkit.Common/Enumerations/XbKSystemClasses.cs b/Migration.Toolkit.Common/Enumerations/XbKSystemClasses.cs index 0f08fdbe..c851f820 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); +// 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 diff --git a/Migration.Toolkit.Common/Enumerations/XbkSystemResource.cs b/Migration.Toolkit.Common/Enumerations/XbkSystemResource.cs index d196606b..669aaa6f 100644 --- a/Migration.Toolkit.Common/Enumerations/XbkSystemResource.cs +++ b/Migration.Toolkit.Common/Enumerations/XbkSystemResource.cs @@ -1,53 +1,53 @@ -// 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); +// 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 diff --git a/Migration.Toolkit.Common/Extensions.cs b/Migration.Toolkit.Common/Extensions.cs index a919a100..a313ab16 100644 --- a/Migration.Toolkit.Common/Extensions.cs +++ b/Migration.Toolkit.Common/Extensions.cs @@ -1,142 +1,144 @@ -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; - } +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 diff --git a/Migration.Toolkit.Common/Helpers/AlignResult.cs b/Migration.Toolkit.Common/Helpers/AlignResult.cs index 36160c20..67ef37ca 100644 --- a/Migration.Toolkit.Common/Helpers/AlignResult.cs +++ b/Migration.Toolkit.Common/Helpers/AlignResult.cs @@ -1,9 +1,9 @@ -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); \ No newline at end of file diff --git a/Migration.Toolkit.Common/Helpers/ConsoleHelper.cs b/Migration.Toolkit.Common/Helpers/ConsoleHelper.cs index c184b8fa..d0104626 100644 --- a/Migration.Toolkit.Common/Helpers/ConsoleHelper.cs +++ b/Migration.Toolkit.Common/Helpers/ConsoleHelper.cs @@ -1,37 +1,37 @@ -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}"; - +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 diff --git a/Migration.Toolkit.Common/Helpers/DeferrableItemEnumerableWrapper.cs b/Migration.Toolkit.Common/Helpers/DeferrableItemEnumerableWrapper.cs index 3e22d1ec..0033a28f 100644 --- a/Migration.Toolkit.Common/Helpers/DeferrableItemEnumerableWrapper.cs +++ b/Migration.Toolkit.Common/Helpers/DeferrableItemEnumerableWrapper.cs @@ -1,51 +1,51 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Common/Helpers/EnumerableHelper.cs b/Migration.Toolkit.Common/Helpers/EnumerableHelper.cs index b7275ec1..7dd31b51 100644 --- a/Migration.Toolkit.Common/Helpers/EnumerableHelper.cs +++ b/Migration.Toolkit.Common/Helpers/EnumerableHelper.cs @@ -1,13 +1,13 @@ -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); - } +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 diff --git a/Migration.Toolkit.Common/Helpers/GuidHelper.cs b/Migration.Toolkit.Common/Helpers/GuidHelper.cs index cfc8f2e3..3aa35823 100644 --- a/Migration.Toolkit.Common/Helpers/GuidHelper.cs +++ b/Migration.Toolkit.Common/Helpers/GuidHelper.cs @@ -1,16 +1,16 @@ -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); +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 diff --git a/Migration.Toolkit.Common/Helpers/GuidV5.cs b/Migration.Toolkit.Common/Helpers/GuidV5.cs index b27c13ee..a889f4c1 100644 --- a/Migration.Toolkit.Common/Helpers/GuidV5.cs +++ b/Migration.Toolkit.Common/Helpers/GuidV5.cs @@ -1,76 +1,76 @@ -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); +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 diff --git a/Migration.Toolkit.Common/Helpers/MediaHelper.cs b/Migration.Toolkit.Common/Helpers/MediaHelper.cs index 99071f5a..3857f466 100644 --- a/Migration.Toolkit.Common/Helpers/MediaHelper.cs +++ b/Migration.Toolkit.Common/Helpers/MediaHelper.cs @@ -1,93 +1,112 @@ -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); - } +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 diff --git a/Migration.Toolkit.Common/Helpers/ReflectionHelper.cs b/Migration.Toolkit.Common/Helpers/ReflectionHelper.cs index 59095363..fd38bac4 100644 --- a/Migration.Toolkit.Common/Helpers/ReflectionHelper.cs +++ b/Migration.Toolkit.Common/Helpers/ReflectionHelper.cs @@ -1,136 +1,136 @@ -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(); +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 diff --git a/Migration.Toolkit.Common/Helpers/SerializationHelper.cs b/Migration.Toolkit.Common/Helpers/SerializationHelper.cs index bac4cea8..6a58ab07 100644 --- a/Migration.Toolkit.Common/Helpers/SerializationHelper.cs +++ b/Migration.Toolkit.Common/Helpers/SerializationHelper.cs @@ -1,33 +1,33 @@ -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 - }); - } +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 diff --git a/Migration.Toolkit.Common/Helpers/SimpleAligner.cs b/Migration.Toolkit.Common/Helpers/SimpleAligner.cs index 7d339d8f..89ac2b41 100644 --- a/Migration.Toolkit.Common/Helpers/SimpleAligner.cs +++ b/Migration.Toolkit.Common/Helpers/SimpleAligner.cs @@ -1,131 +1,131 @@ -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 +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 diff --git a/Migration.Toolkit.Common/Helpers/TreePathConvertor.cs b/Migration.Toolkit.Common/Helpers/TreePathConvertor.cs index 24581006..4573a384 100644 --- a/Migration.Toolkit.Common/Helpers/TreePathConvertor.cs +++ b/Migration.Toolkit.Common/Helpers/TreePathConvertor.cs @@ -1,67 +1,67 @@ -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; - } -} +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 diff --git a/Migration.Toolkit.Common/Helpers/UniqueTreePathProvider.cs b/Migration.Toolkit.Common/Helpers/UniqueTreePathProvider.cs index 22edc53b..0d953423 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; - } +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 diff --git a/Migration.Toolkit.Common/Helpers/UriHelperXbyk.cs b/Migration.Toolkit.Common/Helpers/UriHelperXbyk.cs index 191fb355..15305e96 100644 --- a/Migration.Toolkit.Common/Helpers/UriHelperXbyk.cs +++ b/Migration.Toolkit.Common/Helpers/UriHelperXbyk.cs @@ -1,71 +1,71 @@ -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); - } +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 diff --git a/Migration.Toolkit.Common/Helpers/VersionHelper.cs b/Migration.Toolkit.Common/Helpers/VersionHelper.cs index b6516a3b..2d1f519e 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; - } +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 diff --git a/Migration.Toolkit.Common/IPrimaryKeyMappingContext.cs b/Migration.Toolkit.Common/IPrimaryKeyMappingContext.cs index 5fd0c4bd..6c7c0c85 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); -} +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 diff --git a/Migration.Toolkit.Common/IPrinter.cs b/Migration.Toolkit.Common/IPrinter.cs index 29a3f7f9..522a6f59 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; -// } +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 diff --git a/Migration.Toolkit.Common/LogExtensions.cs b/Migration.Toolkit.Common/LogExtensions.cs index b6c7f89f..3c87b0b8 100644 --- a/Migration.Toolkit.Common/LogExtensions.cs +++ b/Migration.Toolkit.Common/LogExtensions.cs @@ -1,76 +1,76 @@ -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; - } +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 diff --git a/Migration.Toolkit.Common/MigrationProtocol/DebugMigrationProtocol.cs b/Migration.Toolkit.Common/MigrationProtocol/DebugMigrationProtocol.cs index 817e06af..002b2137 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/DebugMigrationProtocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/DebugMigrationProtocol.cs @@ -1,60 +1,60 @@ -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()); - } +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 diff --git a/Migration.Toolkit.Common/MigrationProtocol/HandbookReference.cs b/Migration.Toolkit.Common/MigrationProtocol/HandbookReference.cs index 0f218287..a37d0b5b 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/HandbookReference.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/HandbookReference.cs @@ -1,151 +1,151 @@ -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; - } +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 diff --git a/Migration.Toolkit.Common/MigrationProtocol/HandbookReferences.cs b/Migration.Toolkit.Common/MigrationProtocol/HandbookReferences.cs index 180deec4..b81502ed 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/HandbookReferences.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/HandbookReferences.cs @@ -1,131 +1,131 @@ -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 +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 diff --git a/Migration.Toolkit.Common/MigrationProtocol/IMigrationProtocol.cs b/Migration.Toolkit.Common/MigrationProtocol/IMigrationProtocol.cs index 4ad5ac34..3930e80a 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/IMigrationProtocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/IMigrationProtocol.cs @@ -1,19 +1,19 @@ -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); +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 diff --git a/Migration.Toolkit.Common/MigrationProtocol/IProtocol.cs b/Migration.Toolkit.Common/MigrationProtocol/IProtocol.cs index 5c9682fb..20bd6c8b 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/IProtocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/IProtocol.cs @@ -1,6 +1,6 @@ -namespace Migration.Toolkit.Common.MigrationProtocol; - -public interface IProtocol: IMigrationProtocol -{ - +namespace Migration.Toolkit.Common.MigrationProtocol; + +public interface IProtocol : IMigrationProtocol +{ + } \ No newline at end of file diff --git a/Migration.Toolkit.Common/MigrationProtocol/NullMigrationProtocol.cs b/Migration.Toolkit.Common/MigrationProtocol/NullMigrationProtocol.cs index 7813b3c8..bae3e6df 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/NullMigrationProtocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/NullMigrationProtocol.cs @@ -1,47 +1,47 @@ -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) - { - } -} +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 diff --git a/Migration.Toolkit.Common/MigrationProtocol/Protocol.cs b/Migration.Toolkit.Common/MigrationProtocol/Protocol.cs index ada694a9..999dfcdd 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/Protocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/Protocol.cs @@ -1,86 +1,86 @@ -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); - } - } +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 diff --git a/Migration.Toolkit.Common/MigrationProtocol/TextMigrationProtocol.cs b/Migration.Toolkit.Common/MigrationProtocol/TextMigrationProtocol.cs index b94f076c..a175aac9 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/TextMigrationProtocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/TextMigrationProtocol.cs @@ -1,106 +1,106 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Common/OptInFeatures.cs b/Migration.Toolkit.Common/OptInFeatures.cs index 681fba87..881ad941 100644 --- a/Migration.Toolkit.Common/OptInFeatures.cs +++ b/Migration.Toolkit.Common/OptInFeatures.cs @@ -1,57 +1,57 @@ -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; } +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 diff --git a/Migration.Toolkit.Common/SemanticVersion.cs b/Migration.Toolkit.Common/SemanticVersion.cs index 1faa796b..9b64a37b 100644 --- a/Migration.Toolkit.Common/SemanticVersion.cs +++ b/Migration.Toolkit.Common/SemanticVersion.cs @@ -1,95 +1,95 @@ -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; - } +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 diff --git a/Migration.Toolkit.Common/Services/BulkCopy/BulkCopyRequest.cs b/Migration.Toolkit.Common/Services/BulkCopy/BulkCopyRequest.cs index d7df8210..d6bb8aa0 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/BulkCopyRequest.cs +++ b/Migration.Toolkit.Common/Services/BulkCopy/BulkCopyRequest.cs @@ -1,18 +1,18 @@ -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 +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 diff --git a/Migration.Toolkit.Common/Services/BulkCopy/BulkDataCopyService.cs b/Migration.Toolkit.Common/Services/BulkCopy/BulkDataCopyService.cs index 621269a0..efd6b1bb 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/BulkDataCopyService.cs +++ b/Migration.Toolkit.Common/Services/BulkCopy/BulkDataCopyService.cs @@ -1,234 +1,234 @@ -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 - - } - } +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 diff --git a/Migration.Toolkit.Common/Services/BulkCopy/DataReaderProxyBase.cs b/Migration.Toolkit.Common/Services/BulkCopy/DataReaderProxyBase.cs index 428b6125..2ad77298 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/DataReaderProxyBase.cs +++ b/Migration.Toolkit.Common/Services/BulkCopy/DataReaderProxyBase.cs @@ -1,54 +1,54 @@ -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(); +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 diff --git a/Migration.Toolkit.Common/Services/BulkCopy/FilteredDbDataReader.cs b/Migration.Toolkit.Common/Services/BulkCopy/FilteredDbDataReader.cs index e21cc266..d1ac02c8 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; - } - } +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 diff --git a/Migration.Toolkit.Common/Services/BulkCopy/ValueInterceptingReader.cs b/Migration.Toolkit.Common/Services/BulkCopy/ValueInterceptingReader.cs index 97793bdd..d5dfb102 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/ValueInterceptingReader.cs +++ b/Migration.Toolkit.Common/Services/BulkCopy/ValueInterceptingReader.cs @@ -1,66 +1,66 @@ -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; - } -} +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 diff --git a/Migration.Toolkit.Common/Services/CommandParser.cs b/Migration.Toolkit.Common/Services/CommandParser.cs index 0c60dfb0..c09fe5f1 100644 --- a/Migration.Toolkit.Common/Services/CommandParser.cs +++ b/Migration.Toolkit.Common/Services/CommandParser.cs @@ -1,148 +1,148 @@ -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}"); - } +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 diff --git a/Migration.Toolkit.Common/Services/CoupledDataService.cs b/Migration.Toolkit.Common/Services/CoupledDataService.cs index 6abd619d..19de8466 100644 --- a/Migration.Toolkit.Common/Services/CoupledDataService.cs +++ b/Migration.Toolkit.Common/Services/CoupledDataService.cs @@ -1,42 +1,42 @@ -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; - } +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 diff --git a/Migration.Toolkit.Common/Services/ICommandParser.cs b/Migration.Toolkit.Common/Services/ICommandParser.cs index f98f2a55..d436763d 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); +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 diff --git a/Migration.Toolkit.Common/Services/IPrintService.cs b/Migration.Toolkit.Common/Services/IPrintService.cs index bc5ed1ac..a84d783b 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; +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 diff --git a/Migration.Toolkit.Common/Services/Ipc/IpcService.cs b/Migration.Toolkit.Common/Services/Ipc/IpcService.cs index 9e276583..58f50b66 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; - } +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 diff --git a/Migration.Toolkit.Common/Services/Ipc/Model.cs b/Migration.Toolkit.Common/Services/Ipc/Model.cs index d63d22ae..4fdd5840 100644 --- a/Migration.Toolkit.Common/Services/Ipc/Model.cs +++ b/Migration.Toolkit.Common/Services/Ipc/Model.cs @@ -1,45 +1,45 @@ -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; } +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 diff --git a/Migration.Toolkit.Common/ToolkitConfiguration.cs b/Migration.Toolkit.Common/ToolkitConfiguration.cs index b0e46a02..617cac22 100644 --- a/Migration.Toolkit.Common/ToolkitConfiguration.cs +++ b/Migration.Toolkit.Common/ToolkitConfiguration.cs @@ -1,218 +1,218 @@ -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 +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 diff --git a/Migration.Toolkit.Core.K11/Auxiliary/NodeXmlAdapter.cs b/Migration.Toolkit.Core.K11/Auxiliary/NodeXmlAdapter.cs index 61d14e22..add8a988 100644 --- a/Migration.Toolkit.Core.K11/Auxiliary/NodeXmlAdapter.cs +++ b/Migration.Toolkit.Core.K11/Auxiliary/NodeXmlAdapter.cs @@ -1,73 +1,76 @@ -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; -} +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 ebe7874b..621e207d 100644 --- a/Migration.Toolkit.Core.K11/Behaviors/CommandConstraintBehavior.cs +++ b/Migration.Toolkit.Core.K11/Behaviors/CommandConstraintBehavior.cs @@ -1,285 +1,285 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Behaviors/RequestHandlingBehavior.cs b/Migration.Toolkit.Core.K11/Behaviors/RequestHandlingBehavior.cs index b4eaf86b..1b506353 100644 --- a/Migration.Toolkit.Core.K11/Behaviors/RequestHandlingBehavior.cs +++ b/Migration.Toolkit.Core.K11/Behaviors/RequestHandlingBehavior.cs @@ -1,36 +1,36 @@ -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); - } - } +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 diff --git a/Migration.Toolkit.Core.K11/Behaviors/XbKApiContextBehavior.cs b/Migration.Toolkit.Core.K11/Behaviors/XbKApiContextBehavior.cs index 4d6d3f27..924e3727 100644 --- a/Migration.Toolkit.Core.K11/Behaviors/XbKApiContextBehavior.cs +++ b/Migration.Toolkit.Core.K11/Behaviors/XbKApiContextBehavior.cs @@ -1,41 +1,41 @@ -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(); - } - } +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 diff --git a/Migration.Toolkit.Core.K11/Contexts/KeyMappingContext.cs b/Migration.Toolkit.Core.K11/Contexts/KeyMappingContext.cs index f2298ef5..37aca71d 100644 --- a/Migration.Toolkit.Core.K11/Contexts/KeyMappingContext.cs +++ b/Migration.Toolkit.Core.K11/Contexts/KeyMappingContext.cs @@ -1,33 +1,33 @@ -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); +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 diff --git a/Migration.Toolkit.Core.K11/Contexts/PrimaryKeyMappingContext.cs b/Migration.Toolkit.Core.K11/Contexts/PrimaryKeyMappingContext.cs index 1a2b5d6c..4906381a 100644 --- a/Migration.Toolkit.Core.K11/Contexts/PrimaryKeyMappingContext.cs +++ b/Migration.Toolkit.Core.K11/Contexts/PrimaryKeyMappingContext.cs @@ -1,285 +1,285 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Contexts/SourceInstanceContext.cs b/Migration.Toolkit.Core.K11/Contexts/SourceInstanceContext.cs index 540c3f3e..7fbf5404 100644 --- a/Migration.Toolkit.Core.K11/Contexts/SourceInstanceContext.cs +++ b/Migration.Toolkit.Core.K11/Contexts/SourceInstanceContext.cs @@ -1,99 +1,99 @@ -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}'"); - } - } +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 6be5fb37..8e272ff5 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; +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 diff --git a/Migration.Toolkit.Core.K11/GlobalUsings.cs b/Migration.Toolkit.Core.K11/GlobalUsings.cs index 459e2d71..1d1f2495 100644 --- a/Migration.Toolkit.Core.K11/GlobalUsings.cs +++ b/Migration.Toolkit.Core.K11/GlobalUsings.cs @@ -1,2 +1,2 @@ -global using System; +global using System; global using Migration.Toolkit; \ No newline at end of file diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs index f1432243..209658b7 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs @@ -1,366 +1,366 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs index 9a8d5025..eacd885a 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs @@ -1,284 +1,284 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateMediaLibrariesCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateMediaLibrariesCommandHandler.cs index 4c9755de..223ed29c 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateMediaLibrariesCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateMediaLibrariesCommandHandler.cs @@ -1,256 +1,256 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateMembersCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateMembersCommandHandler.cs index c6289ce1..4e5bbb4d 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() - { - - } +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 diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs index 5fca699d..a28a56c8 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs @@ -1,89 +1,89 @@ -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); - } +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 diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateSitesCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateSitesCommandHandler.cs index 09972e9c..be6454f5 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateSitesCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateSitesCommandHandler.cs @@ -1,236 +1,236 @@ -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"); - } +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 diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateUsersCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateUsersCommandHandler.cs index 2a59a8bf..6ead7bcf 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateUsersCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateUsersCommandHandler.cs @@ -1,267 +1,267 @@ -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() - { - - } +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 diff --git a/Migration.Toolkit.Core.K11/Helpers/KenticoHelper.cs b/Migration.Toolkit.Core.K11/Helpers/KenticoHelper.cs index 98be8d90..ecde8c29 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); - } +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 diff --git a/Migration.Toolkit.Core.K11/Helpers/PrintHelper.cs b/Migration.Toolkit.Core.K11/Helpers/PrintHelper.cs index 4ede1909..481f631b 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 ?? ""}")); +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 diff --git a/Migration.Toolkit.Core.K11/Helpers/Printer.cs b/Migration.Toolkit.Core.K11/Helpers/Printer.cs index 76c18388..17f43ea1 100644 --- a/Migration.Toolkit.Core.K11/Helpers/Printer.cs +++ b/Migration.Toolkit.Core.K11/Helpers/Printer.cs @@ -1,119 +1,120 @@ -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); - } +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 diff --git a/Migration.Toolkit.Core.K11/K11CoreDiExtensions.cs b/Migration.Toolkit.Core.K11/K11CoreDiExtensions.cs index 8561dad9..62cd09c3 100644 --- a/Migration.Toolkit.Core.K11/K11CoreDiExtensions.cs +++ b/Migration.Toolkit.Core.K11/K11CoreDiExtensions.cs @@ -1,107 +1,107 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/AlternativeFormMapper.cs b/Migration.Toolkit.Core.K11/Mappers/AlternativeFormMapper.cs index 6914eff8..15f9c7ef 100644 --- a/Migration.Toolkit.Core.K11/Mappers/AlternativeFormMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/AlternativeFormMapper.cs @@ -1,89 +1,89 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsAttachmentMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsAttachmentMapper.cs index 966126a4..802ef8d2 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsAttachmentMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsAttachmentMapper.cs @@ -1,55 +1,55 @@ -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 LegacyOriginalPath = "__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(LegacyOriginalPath, attachmentDocument.DocumentNode.NodeAliasPath); - } - - return target; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsConsentAgreementMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsConsentAgreementMapper.cs index cefb137c..a8be50a2 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsConsentAgreementMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsConsentAgreementMapper.cs @@ -1,33 +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 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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsConsentArchiveMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsConsentArchiveMapper.cs index 0d04d79d..62bc9cb4 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsConsentArchiveMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsConsentArchiveMapper.cs @@ -1,30 +1,30 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsConsentMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsConsentMapper.cs index 5c8f40c3..0fcb6e73 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsConsentMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsConsentMapper.cs @@ -1,72 +1,72 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsFormMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsFormMapper.cs index f6f44d58..a97be1c9 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsFormMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsFormMapper.cs @@ -1,80 +1,80 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsSettingsCategoryMapper.cs index 722d814d..a5a9a5e6 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsCategoryMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsSettingsCategoryMapper.cs @@ -1,87 +1,87 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsKeyMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsSettingsKeyMapper.cs index af19d2d1..599e46e2 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsKeyMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsSettingsKeyMapper.cs @@ -1,64 +1,64 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsUserMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsUserMapper.cs index 5523689a..cb91b732 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsUserMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsUserMapper.cs @@ -1,58 +1,58 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/CountryInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CountryInfoMapper.cs index 22c1cbd2..73405d49 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CountryInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CountryInfoMapper.cs @@ -1,25 +1,25 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/MediaFileInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/MediaFileInfoMapper.cs index ef7bcfd0..12f8f093 100644 --- a/Migration.Toolkit.Core.K11/Mappers/MediaFileInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/MediaFileInfoMapper.cs @@ -1,159 +1,160 @@ -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"); - } - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/MediaLibraryInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/MediaLibraryInfoMapper.cs index 49f07d30..e1ad240b 100644 --- a/Migration.Toolkit.Core.K11/Mappers/MediaLibraryInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/MediaLibraryInfoMapper.cs @@ -1,38 +1,38 @@ -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; - } +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 fde0f814..3329fdbb 100644 --- a/Migration.Toolkit.Core.K11/Mappers/MemberInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/MemberInfoMapper.cs @@ -1,187 +1,187 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/OmContactGroupMapper.cs b/Migration.Toolkit.Core.K11/Mappers/OmContactGroupMapper.cs index c1c0afe6..bb9f8927 100644 --- a/Migration.Toolkit.Core.K11/Mappers/OmContactGroupMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/OmContactGroupMapper.cs @@ -1,30 +1,30 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/OmContactMapper.cs b/Migration.Toolkit.Core.K11/Mappers/OmContactMapper.cs index 931a9f73..7e380b05 100644 --- a/Migration.Toolkit.Core.K11/Mappers/OmContactMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/OmContactMapper.cs @@ -1,85 +1,85 @@ -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; - } +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 0d74aeb2..68f46d59 100644 --- a/Migration.Toolkit.Core.K11/Mappers/OmContactStatusMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/OmContactStatusMapper.cs @@ -1,26 +1,26 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/ResourceMapper.cs b/Migration.Toolkit.Core.K11/Mappers/ResourceMapper.cs index 258d5e51..a3648e7d 100644 --- a/Migration.Toolkit.Core.K11/Mappers/ResourceMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/ResourceMapper.cs @@ -1,45 +1,45 @@ -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; - } +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 136904bd..2a663f57 100644 --- a/Migration.Toolkit.Core.K11/Mappers/RoleInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/RoleInfoMapper.cs @@ -1,26 +1,26 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/StateInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/StateInfoMapper.cs index 3cfcb914..9aadaebb 100644 --- a/Migration.Toolkit.Core.K11/Mappers/StateInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/StateInfoMapper.cs @@ -1,30 +1,30 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/UserInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/UserInfoMapper.cs index abba9931..97629a89 100644 --- a/Migration.Toolkit.Core.K11/Mappers/UserInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/UserInfoMapper.cs @@ -1,92 +1,92 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Mappers/UserRoleInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/UserRoleInfoMapper.cs index f9622023..bbad5140 100644 --- a/Migration.Toolkit.Core.K11/Mappers/UserRoleInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/UserRoleInfoMapper.cs @@ -1,29 +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 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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Providers/ContentItemNameProvider.cs b/Migration.Toolkit.Core.K11/Providers/ContentItemNameProvider.cs index 34d14f14..1287064c 100644 --- a/Migration.Toolkit.Core.K11/Providers/ContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.K11/Providers/ContentItemNameProvider.cs @@ -1,47 +1,47 @@ -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); - } +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 diff --git a/Migration.Toolkit.Core.K11/Providers/ContentItemNameValidator.cs b/Migration.Toolkit.Core.K11/Providers/ContentItemNameValidator.cs index b43429d2..36b8cfcb 100644 --- a/Migration.Toolkit.Core.K11/Providers/ContentItemNameValidator.cs +++ b/Migration.Toolkit.Core.K11/Providers/ContentItemNameValidator.cs @@ -1,25 +1,25 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.K11/Providers/UniqueContentItemNameProvider.cs b/Migration.Toolkit.Core.K11/Providers/UniqueContentItemNameProvider.cs index d79d925d..c7a968f3 100644 --- a/Migration.Toolkit.Core.K11/Providers/UniqueContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.K11/Providers/UniqueContentItemNameProvider.cs @@ -1,48 +1,48 @@ -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)); - } +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 diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs index ac02088e..4f03240e 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; } +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 diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs index 2b537ab9..599271ae 100644 --- a/Migration.Toolkit.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs +++ b/Migration.Toolkit.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs @@ -1,187 +1,186 @@ -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 - +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 diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/PageSelectorItem.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/PageSelectorItem.cs index c5cf6a4c..241eaf06 100644 --- a/Migration.Toolkit.Core.K11/Services/CmsClass/PageSelectorItem.cs +++ b/Migration.Toolkit.Core.K11/Services/CmsClass/PageSelectorItem.cs @@ -1,11 +1,11 @@ -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; } +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 diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs index b1b0d3a7..bc72637d 100644 --- a/Migration.Toolkit.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs +++ b/Migration.Toolkit.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs @@ -1,29 +1,29 @@ -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; } +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 diff --git a/Migration.Toolkit.Core.K11/Services/CountryMigrator.cs b/Migration.Toolkit.Core.K11/Services/CountryMigrator.cs index 9021b053..bf2126db 100644 --- a/Migration.Toolkit.Core.K11/Services/CountryMigrator.cs +++ b/Migration.Toolkit.Core.K11/Services/CountryMigrator.cs @@ -1,102 +1,102 @@ -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) - ); - } - } - } - } +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 diff --git a/Migration.Toolkit.Core.K11/Services/IPrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.K11/Services/IPrimaryKeyLocatorService.cs index 263b105d..19e6b3c5 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); +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 diff --git a/Migration.Toolkit.Core.K11/Services/KeyLocatorService.cs b/Migration.Toolkit.Core.K11/Services/KeyLocatorService.cs index d8a14c80..599af70e 100644 --- a/Migration.Toolkit.Core.K11/Services/KeyLocatorService.cs +++ b/Migration.Toolkit.Core.K11/Services/KeyLocatorService.cs @@ -1,109 +1,109 @@ -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); - } - } - } +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 diff --git a/Migration.Toolkit.Core.K11/Services/PrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.K11/Services/PrimaryKeyLocatorService.cs index b0e9aaa5..957361d4 100644 --- a/Migration.Toolkit.Core.K11/Services/PrimaryKeyLocatorService.cs +++ b/Migration.Toolkit.Core.K11/Services/PrimaryKeyLocatorService.cs @@ -1,245 +1,245 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.K11/Services/TableReflectionService.cs b/Migration.Toolkit.Core.K11/Services/TableReflectionService.cs index 98c16eaa..08965db1 100644 --- a/Migration.Toolkit.Core.K11/Services/TableReflectionService.cs +++ b/Migration.Toolkit.Core.K11/Services/TableReflectionService.cs @@ -1,45 +1,45 @@ -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]; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Auxiliary/NodeXmlAdapter.cs b/Migration.Toolkit.Core.KX12/Auxiliary/NodeXmlAdapter.cs index 2371291a..9996072b 100644 --- a/Migration.Toolkit.Core.KX12/Auxiliary/NodeXmlAdapter.cs +++ b/Migration.Toolkit.Core.KX12/Auxiliary/NodeXmlAdapter.cs @@ -1,73 +1,76 @@ -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; -} +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 42675e71..7129d51f 100644 --- a/Migration.Toolkit.Core.KX12/Behaviors/CommandConstraintBehavior.cs +++ b/Migration.Toolkit.Core.KX12/Behaviors/CommandConstraintBehavior.cs @@ -1,300 +1,300 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Behaviors/RequestHandlingBehavior.cs b/Migration.Toolkit.Core.KX12/Behaviors/RequestHandlingBehavior.cs index 53d6bacd..48a87f6e 100644 --- a/Migration.Toolkit.Core.KX12/Behaviors/RequestHandlingBehavior.cs +++ b/Migration.Toolkit.Core.KX12/Behaviors/RequestHandlingBehavior.cs @@ -1,36 +1,36 @@ -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); - } - } +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 diff --git a/Migration.Toolkit.Core.KX12/Behaviors/XbKApiContextBehavior.cs b/Migration.Toolkit.Core.KX12/Behaviors/XbKApiContextBehavior.cs index b0be712c..30e98c61 100644 --- a/Migration.Toolkit.Core.KX12/Behaviors/XbKApiContextBehavior.cs +++ b/Migration.Toolkit.Core.KX12/Behaviors/XbKApiContextBehavior.cs @@ -1,53 +1,53 @@ -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(); - } - } +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 diff --git a/Migration.Toolkit.Core.KX12/Contexts/KeyMappingContext.cs b/Migration.Toolkit.Core.KX12/Contexts/KeyMappingContext.cs index 48546086..5463364e 100644 --- a/Migration.Toolkit.Core.KX12/Contexts/KeyMappingContext.cs +++ b/Migration.Toolkit.Core.KX12/Contexts/KeyMappingContext.cs @@ -1,42 +1,42 @@ -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); +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 diff --git a/Migration.Toolkit.Core.KX12/Contexts/PrimaryKeyMappingContext.cs b/Migration.Toolkit.Core.KX12/Contexts/PrimaryKeyMappingContext.cs index 93f40b6a..c2413042 100644 --- a/Migration.Toolkit.Core.KX12/Contexts/PrimaryKeyMappingContext.cs +++ b/Migration.Toolkit.Core.KX12/Contexts/PrimaryKeyMappingContext.cs @@ -1,297 +1,297 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Contexts/SourceInstanceContext.cs b/Migration.Toolkit.Core.KX12/Contexts/SourceInstanceContext.cs index ac055bc0..8b8e4c07 100644 --- a/Migration.Toolkit.Core.KX12/Contexts/SourceInstanceContext.cs +++ b/Migration.Toolkit.Core.KX12/Contexts/SourceInstanceContext.cs @@ -1,112 +1,112 @@ -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}'"); - } - } +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 083e6b90..7e725554 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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/GlobalUsings.cs b/Migration.Toolkit.Core.KX12/GlobalUsings.cs index a60b2bf2..f262502b 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 System; +global using KX12M = Migration.Toolkit.KX12.Models; global using Migration.Toolkit; \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs index c01b6e43..f87544f9 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs @@ -1,368 +1,368 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs index 1f932527..52d3d75a 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs @@ -1,284 +1,284 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateMediaLibrariesCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateMediaLibrariesCommandHandler.cs index 4d501541..d53984a6 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateMediaLibrariesCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateMediaLibrariesCommandHandler.cs @@ -1,247 +1,247 @@ -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(); - } +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 570cb3e4..d2cc6bb5 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateMembersCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateMembersCommandHandler.cs @@ -1,110 +1,110 @@ -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() - { - - } +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 diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs index 44c748e4..06ad3826 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs @@ -1,105 +1,105 @@ -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); - } +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 diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateSitesCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateSitesCommandHandler.cs index 03e56d25..19d85d09 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateSitesCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateSitesCommandHandler.cs @@ -1,187 +1,187 @@ -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"); - } +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 diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateUsersCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateUsersCommandHandler.cs index d3393136..fe021393 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateUsersCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateUsersCommandHandler.cs @@ -1,254 +1,254 @@ -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() - { - - } +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 diff --git a/Migration.Toolkit.Core.KX12/Helpers/KenticoHelper.cs b/Migration.Toolkit.Core.KX12/Helpers/KenticoHelper.cs index 8a1dbe13..dae5f108 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); - } +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 diff --git a/Migration.Toolkit.Core.KX12/Helpers/PrintHelper.cs b/Migration.Toolkit.Core.KX12/Helpers/PrintHelper.cs index 001ed032..8374b51b 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 ?? ""}")); +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 diff --git a/Migration.Toolkit.Core.KX12/Helpers/Printer.cs b/Migration.Toolkit.Core.KX12/Helpers/Printer.cs index 55d5126b..378d3071 100644 --- a/Migration.Toolkit.Core.KX12/Helpers/Printer.cs +++ b/Migration.Toolkit.Core.KX12/Helpers/Printer.cs @@ -1,120 +1,121 @@ -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); - } +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 diff --git a/Migration.Toolkit.Core.KX12/KX12CoreDiExtensions.cs b/Migration.Toolkit.Core.KX12/KX12CoreDiExtensions.cs index 040d64bb..35dc8415 100644 --- a/Migration.Toolkit.Core.KX12/KX12CoreDiExtensions.cs +++ b/Migration.Toolkit.Core.KX12/KX12CoreDiExtensions.cs @@ -1,107 +1,107 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/AlternativeFormMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/AlternativeFormMapper.cs index 19e4dde1..c5fd14a5 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/AlternativeFormMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/AlternativeFormMapper.cs @@ -1,96 +1,96 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsAttachmentMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsAttachmentMapper.cs index 09e4b716..681b9926 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsAttachmentMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsAttachmentMapper.cs @@ -1,59 +1,59 @@ -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 LegacyOriginalPath = "__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(LegacyOriginalPath, attachmentDocument.DocumentNode.NodeAliasPath); - } - - return target; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentAgreementMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentAgreementMapper.cs index f86d32f1..fc5bd35a 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentAgreementMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentAgreementMapper.cs @@ -1,36 +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 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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentArchiveMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentArchiveMapper.cs index 370de111..8c98b7a9 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentArchiveMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentArchiveMapper.cs @@ -1,33 +1,33 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentMapper.cs index 54059f8c..5a72fbb2 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentMapper.cs @@ -1,76 +1,76 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsFormMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsFormMapper.cs index 7ad6fcb9..3fb16582 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsFormMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsFormMapper.cs @@ -1,92 +1,92 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs index 42b4f43d..f102bfd3 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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsKeyMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsKeyMapper.cs index c1c8d357..71b23fcc 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsKeyMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsKeyMapper.cs @@ -1,68 +1,68 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsUserMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsUserMapper.cs index b3a07aca..a97d5d19 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsUserMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsUserMapper.cs @@ -1,66 +1,66 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/CountryInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CountryInfoMapper.cs index cd183447..834b430e 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CountryInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CountryInfoMapper.cs @@ -1,29 +1,29 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/MediaFileInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/MediaFileInfoMapper.cs index e6050e3f..7cb353a3 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/MediaFileInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/MediaFileInfoMapper.cs @@ -1,173 +1,174 @@ -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"); - } - } +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 index 13e1a916..7be47dc9 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/MediaLibraryInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/MediaLibraryInfoMapper.cs @@ -1,42 +1,42 @@ -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; - } +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 b8feaad9..588f3f0c 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/MemberInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/MemberInfoMapper.cs @@ -1,189 +1,189 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/OmContactGroupMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/OmContactGroupMapper.cs index efc25246..66b4cd48 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/OmContactGroupMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/OmContactGroupMapper.cs @@ -1,35 +1,35 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/OmContactMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/OmContactMapper.cs index fe4574bf..040e8700 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/OmContactMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/OmContactMapper.cs @@ -1,95 +1,95 @@ -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; - } +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 0fae331d..8ab2ce85 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/OmContactStatusMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/OmContactStatusMapper.cs @@ -1,31 +1,31 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/ResourceMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/ResourceMapper.cs index 9d45f7bf..b24bf72f 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/ResourceMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/ResourceMapper.cs @@ -1,52 +1,52 @@ -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; - } +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 d0339285..856d1e9f 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/RoleInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/RoleInfoMapper.cs @@ -1,30 +1,30 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/StateInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/StateInfoMapper.cs index a9a046e0..bb948da0 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/StateInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/StateInfoMapper.cs @@ -1,34 +1,34 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/UserInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/UserInfoMapper.cs index 91c239d8..54727e9a 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/UserInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/UserInfoMapper.cs @@ -1,109 +1,109 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Mappers/UserRoleInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/UserRoleInfoMapper.cs index 91dad88c..9a0b9be8 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/UserRoleInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/UserRoleInfoMapper.cs @@ -1,32 +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 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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameProvider.cs b/Migration.Toolkit.Core.KX12/Providers/ContentItemNameProvider.cs index 64e2c39d..369f0858 100644 --- a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.KX12/Providers/ContentItemNameProvider.cs @@ -1,47 +1,47 @@ -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); - } +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 diff --git a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameValidator.cs b/Migration.Toolkit.Core.KX12/Providers/ContentItemNameValidator.cs index 67274a06..bccb5914 100644 --- a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameValidator.cs +++ b/Migration.Toolkit.Core.KX12/Providers/ContentItemNameValidator.cs @@ -1,25 +1,25 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.KX12/Providers/UniqueContentItemNameProvider.cs b/Migration.Toolkit.Core.KX12/Providers/UniqueContentItemNameProvider.cs index cb183552..4a7affe3 100644 --- a/Migration.Toolkit.Core.KX12/Providers/UniqueContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.KX12/Providers/UniqueContentItemNameProvider.cs @@ -1,48 +1,48 @@ -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)); - } +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 diff --git a/Migration.Toolkit.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Toolkit.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs index d4442a8f..6e1f0286 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; } +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 diff --git a/Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs b/Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs index 390be54f..f4668789 100644 --- a/Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs +++ b/Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs @@ -1,187 +1,186 @@ -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 - +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 index 94f35678..00432666 100644 --- a/Migration.Toolkit.Core.KX12/Services/CmsClass/PageSelectorItem.cs +++ b/Migration.Toolkit.Core.KX12/Services/CmsClass/PageSelectorItem.cs @@ -1,11 +1,11 @@ -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; } +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 index ee813b8d..f2885705 100644 --- a/Migration.Toolkit.Core.KX12/Services/CmsClass/PageTemplateConfiguration.cs +++ b/Migration.Toolkit.Core.KX12/Services/CmsClass/PageTemplateConfiguration.cs @@ -1,29 +1,29 @@ -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; } +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 8164ba92..043db008 100644 --- a/Migration.Toolkit.Core.KX12/Services/CountryMigrator.cs +++ b/Migration.Toolkit.Core.KX12/Services/CountryMigrator.cs @@ -1,123 +1,123 @@ -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) - ); - } - } - } - } +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 diff --git a/Migration.Toolkit.Core.KX12/Services/IPrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX12/Services/IPrimaryKeyLocatorService.cs index 97bf033d..8e873085 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); +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 diff --git a/Migration.Toolkit.Core.KX12/Services/KeyLocatorService.cs b/Migration.Toolkit.Core.KX12/Services/KeyLocatorService.cs index dbe3e95c..54247c61 100644 --- a/Migration.Toolkit.Core.KX12/Services/KeyLocatorService.cs +++ b/Migration.Toolkit.Core.KX12/Services/KeyLocatorService.cs @@ -1,122 +1,122 @@ -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); - } - } - } +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 diff --git a/Migration.Toolkit.Core.KX12/Services/PrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX12/Services/PrimaryKeyLocatorService.cs index a0feae36..42ea6d85 100644 --- a/Migration.Toolkit.Core.KX12/Services/PrimaryKeyLocatorService.cs +++ b/Migration.Toolkit.Core.KX12/Services/PrimaryKeyLocatorService.cs @@ -1,263 +1,263 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX12/Services/TableReflectionService.cs b/Migration.Toolkit.Core.KX12/Services/TableReflectionService.cs index 571b064b..4bde41d7 100644 --- a/Migration.Toolkit.Core.KX12/Services/TableReflectionService.cs +++ b/Migration.Toolkit.Core.KX12/Services/TableReflectionService.cs @@ -1,45 +1,45 @@ -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]; - } +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 index a07dec96..d5ecc788 100644 --- a/Migration.Toolkit.Core.KX13/Auxiliary/NodeXmlAdapter.cs +++ b/Migration.Toolkit.Core.KX13/Auxiliary/NodeXmlAdapter.cs @@ -1,73 +1,76 @@ -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; -} +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 674ef5c4..0ee676f6 100644 --- a/Migration.Toolkit.Core.KX13/Behaviors/CommandConstraintBehavior.cs +++ b/Migration.Toolkit.Core.KX13/Behaviors/CommandConstraintBehavior.cs @@ -1,301 +1,301 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Behaviors/RequestHandlingBehavior.cs b/Migration.Toolkit.Core.KX13/Behaviors/RequestHandlingBehavior.cs index c3446e13..9f6ed038 100644 --- a/Migration.Toolkit.Core.KX13/Behaviors/RequestHandlingBehavior.cs +++ b/Migration.Toolkit.Core.KX13/Behaviors/RequestHandlingBehavior.cs @@ -1,47 +1,47 @@ -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); - } - } +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 diff --git a/Migration.Toolkit.Core.KX13/Behaviors/XbKApiContextBehavior.cs b/Migration.Toolkit.Core.KX13/Behaviors/XbKApiContextBehavior.cs index ef60ad80..84fd5f39 100644 --- a/Migration.Toolkit.Core.KX13/Behaviors/XbKApiContextBehavior.cs +++ b/Migration.Toolkit.Core.KX13/Behaviors/XbKApiContextBehavior.cs @@ -1,53 +1,53 @@ -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(); - } - } +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 diff --git a/Migration.Toolkit.Core.KX13/Contexts/KeyMappingContext.cs b/Migration.Toolkit.Core.KX13/Contexts/KeyMappingContext.cs index 88bac073..a21464d2 100644 --- a/Migration.Toolkit.Core.KX13/Contexts/KeyMappingContext.cs +++ b/Migration.Toolkit.Core.KX13/Contexts/KeyMappingContext.cs @@ -1,42 +1,42 @@ -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); +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 diff --git a/Migration.Toolkit.Core.KX13/Contexts/PrimaryKeyMappingContext.cs b/Migration.Toolkit.Core.KX13/Contexts/PrimaryKeyMappingContext.cs index 72e15c8d..f48e3d69 100644 --- a/Migration.Toolkit.Core.KX13/Contexts/PrimaryKeyMappingContext.cs +++ b/Migration.Toolkit.Core.KX13/Contexts/PrimaryKeyMappingContext.cs @@ -1,285 +1,285 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Contexts/SourceInstanceContext.cs b/Migration.Toolkit.Core.KX13/Contexts/SourceInstanceContext.cs index 6d996e9c..ed104049 100644 --- a/Migration.Toolkit.Core.KX13/Contexts/SourceInstanceContext.cs +++ b/Migration.Toolkit.Core.KX13/Contexts/SourceInstanceContext.cs @@ -1,110 +1,110 @@ -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}'"); - } +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 aca846c7..448e071b 100644 --- a/Migration.Toolkit.Core.KX13/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.Core.KX13/DependencyInjectionExtensions.cs @@ -1,107 +1,107 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Exceptions.cs b/Migration.Toolkit.Core.KX13/Exceptions.cs index e3b8e8ee..b58523a0 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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/GlobalUsings.cs b/Migration.Toolkit.Core.KX13/GlobalUsings.cs index 53b21d35..f177493b 100644 --- a/Migration.Toolkit.Core.KX13/GlobalUsings.cs +++ b/Migration.Toolkit.Core.KX13/GlobalUsings.cs @@ -1,2 +1,2 @@ -global using System; +global using System; global using KX13M = Migration.Toolkit.KX13.Models; \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs index 0508946d..90244fc3 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs @@ -1,388 +1,388 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs index b97d1ac2..a737f6cb 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs @@ -1,284 +1,284 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateMediaLibrariesCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateMediaLibrariesCommandHandler.cs index 84296e39..0886c0e5 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateMediaLibrariesCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateMediaLibrariesCommandHandler.cs @@ -1,247 +1,247 @@ -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(); - } +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 20db298c..ba03479f 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateMembersCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateMembersCommandHandler.cs @@ -1,111 +1,111 @@ -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() - { - - } +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 diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs index 4502281c..f40f424b 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs @@ -1,105 +1,105 @@ -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); - } +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 diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateSitesCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateSitesCommandHandler.cs index 8a8b6c82..b0a72c2b 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"); - } +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 diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateUsersCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateUsersCommandHandler.cs index c7356afd..bde724e7 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateUsersCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateUsersCommandHandler.cs @@ -1,254 +1,254 @@ -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() - { - - } +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 diff --git a/Migration.Toolkit.Core.KX13/Helpers/KenticoHelper.cs b/Migration.Toolkit.Core.KX13/Helpers/KenticoHelper.cs index 7125b1c3..5328d9e4 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); - } +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 diff --git a/Migration.Toolkit.Core.KX13/Helpers/PrintHelper.cs b/Migration.Toolkit.Core.KX13/Helpers/PrintHelper.cs index c63e9e26..95b4e30c 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 ?? ""}")); +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 diff --git a/Migration.Toolkit.Core.KX13/Helpers/Printer.cs b/Migration.Toolkit.Core.KX13/Helpers/Printer.cs index a92147bb..f9479aca 100644 --- a/Migration.Toolkit.Core.KX13/Helpers/Printer.cs +++ b/Migration.Toolkit.Core.KX13/Helpers/Printer.cs @@ -1,120 +1,121 @@ -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); - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/AlternativeFormMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/AlternativeFormMapper.cs index 80880262..542e4c22 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/AlternativeFormMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/AlternativeFormMapper.cs @@ -1,96 +1,96 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsAttachmentMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsAttachmentMapper.cs index cb8b3ed7..da40f84d 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsAttachmentMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsAttachmentMapper.cs @@ -1,59 +1,59 @@ -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 LegacyOriginalPath = "__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(LegacyOriginalPath, attachmentDocument.DocumentNode.NodeAliasPath); - } - - return target; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentAgreementMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentAgreementMapper.cs index 5500ba9d..65b52f5c 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentAgreementMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentAgreementMapper.cs @@ -1,36 +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 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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentArchiveMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentArchiveMapper.cs index d38916bc..8e6eade5 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentArchiveMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentArchiveMapper.cs @@ -1,33 +1,33 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentMapper.cs index 9d8df42e..02f40ac1 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentMapper.cs @@ -1,76 +1,76 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs index f1b4c5ff..898902ac 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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsKeyMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsKeyMapper.cs index ba760731..0f2f48c8 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsKeyMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsKeyMapper.cs @@ -1,68 +1,68 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsUserMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsUserMapper.cs index fd14bf6c..515352a5 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsUserMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsUserMapper.cs @@ -1,66 +1,66 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/CountryInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CountryInfoMapper.cs index 40a12068..adee6bd2 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CountryInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CountryInfoMapper.cs @@ -1,29 +1,29 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/MediaFileInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/MediaFileInfoMapper.cs index 739df2c1..fced1152 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/MediaFileInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/MediaFileInfoMapper.cs @@ -1,173 +1,174 @@ -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"); - } - } +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 index 4f5d70f9..6b11cc2f 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/MediaLibraryInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/MediaLibraryInfoMapper.cs @@ -1,42 +1,42 @@ -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; - } +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 6012b9a2..0087c754 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/MemberInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/MemberInfoMapper.cs @@ -1,187 +1,187 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/OmContactGroupMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/OmContactGroupMapper.cs index f410c816..214737cd 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/OmContactGroupMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/OmContactGroupMapper.cs @@ -1,35 +1,35 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/OmContactMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/OmContactMapper.cs index 13bccdf6..1b14b524 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/OmContactMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/OmContactMapper.cs @@ -1,95 +1,95 @@ -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; - } +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 8ceb83fa..bbd2076c 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/OmContactStatusMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/OmContactStatusMapper.cs @@ -1,31 +1,31 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/PageTemplateConfigurationMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/PageTemplateConfigurationMapper.cs index 26ce14f8..22286810 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/PageTemplateConfigurationMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/PageTemplateConfigurationMapper.cs @@ -1,223 +1,223 @@ -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 +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 index a36796ef..2af18813 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/ResourceMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/ResourceMapper.cs @@ -1,52 +1,52 @@ -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; - } +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 9115c30e..4b41239b 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/RoleInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/RoleInfoMapper.cs @@ -1,30 +1,30 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/StateInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/StateInfoMapper.cs index 576ab258..20b4505f 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/StateInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/StateInfoMapper.cs @@ -1,34 +1,34 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/UserInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/UserInfoMapper.cs index d4b12957..e946d178 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/UserInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/UserInfoMapper.cs @@ -1,109 +1,109 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Mappers/UserRoleInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/UserRoleInfoMapper.cs index 93c973d1..5fd05810 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/UserRoleInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/UserRoleInfoMapper.cs @@ -1,32 +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 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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameProvider.cs b/Migration.Toolkit.Core.KX13/Providers/ContentItemNameProvider.cs index eec19758..a4667a0b 100644 --- a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.KX13/Providers/ContentItemNameProvider.cs @@ -1,47 +1,47 @@ -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); - } +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 diff --git a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameValidator.cs b/Migration.Toolkit.Core.KX13/Providers/ContentItemNameValidator.cs index d0c58ac2..01c80a2d 100644 --- a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameValidator.cs +++ b/Migration.Toolkit.Core.KX13/Providers/ContentItemNameValidator.cs @@ -1,25 +1,25 @@ -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(); - } +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 diff --git a/Migration.Toolkit.Core.KX13/Providers/UniqueContentItemNameProvider.cs b/Migration.Toolkit.Core.KX13/Providers/UniqueContentItemNameProvider.cs index ee76a608..aa814050 100644 --- a/Migration.Toolkit.Core.KX13/Providers/UniqueContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.KX13/Providers/UniqueContentItemNameProvider.cs @@ -1,48 +1,48 @@ -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)); - } +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 diff --git a/Migration.Toolkit.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Toolkit.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs index 0bc3a300..c1a00a2d 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; } +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 diff --git a/Migration.Toolkit.Core.KX13/Services/CmsClass/EditableAreasConfiguration.cs b/Migration.Toolkit.Core.KX13/Services/CmsClass/EditableAreasConfiguration.cs index 634f8de2..b4c762ab 100644 --- a/Migration.Toolkit.Core.KX13/Services/CmsClass/EditableAreasConfiguration.cs +++ b/Migration.Toolkit.Core.KX13/Services/CmsClass/EditableAreasConfiguration.cs @@ -1,187 +1,186 @@ -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 - +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 index 7b6941b0..5740175d 100644 --- a/Migration.Toolkit.Core.KX13/Services/CmsClass/PageSelectorItem.cs +++ b/Migration.Toolkit.Core.KX13/Services/CmsClass/PageSelectorItem.cs @@ -1,11 +1,11 @@ -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; } +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 index 501d10c7..52be7651 100644 --- a/Migration.Toolkit.Core.KX13/Services/CmsClass/PageTemplateConfiguration.cs +++ b/Migration.Toolkit.Core.KX13/Services/CmsClass/PageTemplateConfiguration.cs @@ -1,29 +1,29 @@ -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; } +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 3132a2e6..5815c15f 100644 --- a/Migration.Toolkit.Core.KX13/Services/CountryMigrator.cs +++ b/Migration.Toolkit.Core.KX13/Services/CountryMigrator.cs @@ -1,124 +1,124 @@ -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) - ); - } - } - } - } +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 diff --git a/Migration.Toolkit.Core.KX13/Services/IPrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX13/Services/IPrimaryKeyLocatorService.cs index 031b99b0..e92620c7 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); +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 diff --git a/Migration.Toolkit.Core.KX13/Services/KeyLocatorService.cs b/Migration.Toolkit.Core.KX13/Services/KeyLocatorService.cs index 142e650a..0fed9fd0 100644 --- a/Migration.Toolkit.Core.KX13/Services/KeyLocatorService.cs +++ b/Migration.Toolkit.Core.KX13/Services/KeyLocatorService.cs @@ -1,122 +1,122 @@ -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); - } - } - } +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 diff --git a/Migration.Toolkit.Core.KX13/Services/PrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX13/Services/PrimaryKeyLocatorService.cs index 17ed7b66..f19f4595 100644 --- a/Migration.Toolkit.Core.KX13/Services/PrimaryKeyLocatorService.cs +++ b/Migration.Toolkit.Core.KX13/Services/PrimaryKeyLocatorService.cs @@ -1,260 +1,260 @@ -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; - } +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 diff --git a/Migration.Toolkit.Core.KX13/Services/TableReflectionService.cs b/Migration.Toolkit.Core.KX13/Services/TableReflectionService.cs index efb3db12..c58881ce 100644 --- a/Migration.Toolkit.Core.KX13/Services/TableReflectionService.cs +++ b/Migration.Toolkit.Core.KX13/Services/TableReflectionService.cs @@ -1,44 +1,44 @@ -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]; - } +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 723a7c70..a6c6af79 100644 --- a/Migration.Toolkit.K11/Auxiliary/Kx13FormControls.cs +++ b/Migration.Toolkit.K11/Auxiliary/Kx13FormControls.cs @@ -1,233 +1,233 @@ -// 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"; - } +// 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 diff --git a/Migration.Toolkit.K11/Context/K11Context.cs b/Migration.Toolkit.K11/Context/K11Context.cs index d98bc7e3..d52af77e 100644 --- a/Migration.Toolkit.K11/Context/K11Context.cs +++ b/Migration.Toolkit.K11/Context/K11Context.cs @@ -1,5760 +1,5760 @@ -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); -} +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 diff --git a/Migration.Toolkit.K11/ContextCustomizations.cs b/Migration.Toolkit.K11/ContextCustomizations.cs index ddfed0eb..4aedb9eb 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); - } +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 diff --git a/Migration.Toolkit.K11/DependencyInjectionExtensions.cs b/Migration.Toolkit.K11/DependencyInjectionExtensions.cs index 93753b61..787ccdff 100644 --- a/Migration.Toolkit.K11/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.K11/DependencyInjectionExtensions.cs @@ -1,14 +1,14 @@ -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; - } +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaign.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaign.cs index 8bc93593..31732672 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaign.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaign.cs @@ -1,74 +1,74 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignAsset.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignAsset.cs index ba221202..9177f72e 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignAsset.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaignAsset.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignAssetUrl.cs index 878a6c64..51619545 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignAssetUrl.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaignAssetUrl.cs @@ -1,30 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversion.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignConversion.cs index 0310f078..63684a30 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversion.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaignConversion.cs @@ -1,56 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversionHit.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignConversionHit.cs index 71b0ea71..38d71506 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversionHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaignConversionHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignObjective.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignObjective.cs index dfed6fc6..9e10951e 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignObjective.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaignObjective.cs @@ -1,37 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsConversion.cs b/Migration.Toolkit.K11/Models/AnalyticsConversion.cs index 1008e1f9..477f1893 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsConversion.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsConversion.cs @@ -1,36 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsDayHit.cs b/Migration.Toolkit.K11/Models/AnalyticsDayHit.cs index 55b1a784..dc664db0 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsDayHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsDayHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsExitPage.cs b/Migration.Toolkit.K11/Models/AnalyticsExitPage.cs index c3fffb7e..7039d8b6 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsExitPage.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsExitPage.cs @@ -1,27 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsHourHit.cs b/Migration.Toolkit.K11/Models/AnalyticsHourHit.cs index c478bc77..39be47ba 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsHourHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsHourHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsMonthHit.cs b/Migration.Toolkit.K11/Models/AnalyticsMonthHit.cs index 397d7c93..0679ebaa 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsMonthHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsMonthHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsStatistic.cs b/Migration.Toolkit.K11/Models/AnalyticsStatistic.cs index dcbb865e..8b2d9d9d 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsStatistic.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsStatistic.cs @@ -1,50 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsWeekHit.cs b/Migration.Toolkit.K11/Models/AnalyticsWeekHit.cs index 8758d0b1..4d1d278e 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsWeekHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsWeekHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/AnalyticsYearHit.cs b/Migration.Toolkit.K11/Models/AnalyticsYearHit.cs index 8e7457fc..69d6ff6d 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsYearHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsYearHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/BadWordsWord.cs b/Migration.Toolkit.K11/Models/BadWordsWord.cs index a715037f..7163c9c1 100644 --- a/Migration.Toolkit.K11/Models/BadWordsWord.cs +++ b/Migration.Toolkit.K11/Models/BadWordsWord.cs @@ -1,39 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/BlogComment.cs b/Migration.Toolkit.K11/Models/BlogComment.cs index 0705a7c4..1b9b2165 100644 --- a/Migration.Toolkit.K11/Models/BlogComment.cs +++ b/Migration.Toolkit.K11/Models/BlogComment.cs @@ -1,61 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/BlogPostSubscription.cs b/Migration.Toolkit.K11/Models/BlogPostSubscription.cs index 882659ef..479eab31 100644 --- a/Migration.Toolkit.K11/Models/BlogPostSubscription.cs +++ b/Migration.Toolkit.K11/Models/BlogPostSubscription.cs @@ -1,44 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/BoardBoard.cs b/Migration.Toolkit.K11/Models/BoardBoard.cs index b0f0d340..6793f1a3 100644 --- a/Migration.Toolkit.K11/Models/BoardBoard.cs +++ b/Migration.Toolkit.K11/Models/BoardBoard.cs @@ -1,117 +1,117 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/BoardMessage.cs b/Migration.Toolkit.K11/Models/BoardMessage.cs index bc23b50c..6e18c76d 100644 --- a/Migration.Toolkit.K11/Models/BoardMessage.cs +++ b/Migration.Toolkit.K11/Models/BoardMessage.cs @@ -1,70 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/BoardSubscription.cs b/Migration.Toolkit.K11/Models/BoardSubscription.cs index 0e792d42..55d1d347 100644 --- a/Migration.Toolkit.K11/Models/BoardSubscription.cs +++ b/Migration.Toolkit.K11/Models/BoardSubscription.cs @@ -1,44 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ChatInitiatedChatRequest.cs b/Migration.Toolkit.K11/Models/ChatInitiatedChatRequest.cs index 44279e93..a0cedf2a 100644 --- a/Migration.Toolkit.K11/Models/ChatInitiatedChatRequest.cs +++ b/Migration.Toolkit.K11/Models/ChatInitiatedChatRequest.cs @@ -1,50 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ChatMessage.cs b/Migration.Toolkit.K11/Models/ChatMessage.cs index 4e62ac63..b3efe25a 100644 --- a/Migration.Toolkit.K11/Models/ChatMessage.cs +++ b/Migration.Toolkit.K11/Models/ChatMessage.cs @@ -1,54 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ChatNotification.cs b/Migration.Toolkit.K11/Models/ChatNotification.cs index 1bd69821..00bd6f6a 100644 --- a/Migration.Toolkit.K11/Models/ChatNotification.cs +++ b/Migration.Toolkit.K11/Models/ChatNotification.cs @@ -1,55 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ChatOnlineSupport.cs b/Migration.Toolkit.K11/Models/ChatOnlineSupport.cs index 8fe9c51c..85df890f 100644 --- a/Migration.Toolkit.K11/Models/ChatOnlineSupport.cs +++ b/Migration.Toolkit.K11/Models/ChatOnlineSupport.cs @@ -1,37 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ChatOnlineUser.cs b/Migration.Toolkit.K11/Models/ChatOnlineUser.cs index 5ac36527..7efb7537 100644 --- a/Migration.Toolkit.K11/Models/ChatOnlineUser.cs +++ b/Migration.Toolkit.K11/Models/ChatOnlineUser.cs @@ -1,43 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ChatPopupWindowSetting.cs b/Migration.Toolkit.K11/Models/ChatPopupWindowSetting.cs index 6aa76dca..c795ecfe 100644 --- a/Migration.Toolkit.K11/Models/ChatPopupWindowSetting.cs +++ b/Migration.Toolkit.K11/Models/ChatPopupWindowSetting.cs @@ -1,29 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ChatRoom.cs b/Migration.Toolkit.K11/Models/ChatRoom.cs index 0a0c4dfb..c2ee0ba4 100644 --- a/Migration.Toolkit.K11/Models/ChatRoom.cs +++ b/Migration.Toolkit.K11/Models/ChatRoom.cs @@ -1,81 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ChatRoomUser.cs b/Migration.Toolkit.K11/Models/ChatRoomUser.cs index 32bcbe68..88e9c9f2 100644 --- a/Migration.Toolkit.K11/Models/ChatRoomUser.cs +++ b/Migration.Toolkit.K11/Models/ChatRoomUser.cs @@ -1,44 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ChatSupportCannedResponse.cs b/Migration.Toolkit.K11/Models/ChatSupportCannedResponse.cs index 0a0ed664..ce0233be 100644 --- a/Migration.Toolkit.K11/Models/ChatSupportCannedResponse.cs +++ b/Migration.Toolkit.K11/Models/ChatSupportCannedResponse.cs @@ -1,40 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ChatSupportTakenRoom.cs b/Migration.Toolkit.K11/Models/ChatSupportTakenRoom.cs index 414970b2..c4cd93d3 100644 --- a/Migration.Toolkit.K11/Models/ChatSupportTakenRoom.cs +++ b/Migration.Toolkit.K11/Models/ChatSupportTakenRoom.cs @@ -1,35 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ChatUser.cs b/Migration.Toolkit.K11/Models/ChatUser.cs index 86f4904c..8404d617 100644 --- a/Migration.Toolkit.K11/Models/ChatUser.cs +++ b/Migration.Toolkit.K11/Models/ChatUser.cs @@ -1,61 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CiFileMetadatum.cs b/Migration.Toolkit.K11/Models/CiFileMetadatum.cs index b3055f83..1f13cab5 100644 --- a/Migration.Toolkit.K11/Models/CiFileMetadatum.cs +++ b/Migration.Toolkit.K11/Models/CiFileMetadatum.cs @@ -1,22 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CiMigration.cs b/Migration.Toolkit.K11/Models/CiMigration.cs index 06a437b9..d2a67e2c 100644 --- a/Migration.Toolkit.K11/Models/CiMigration.cs +++ b/Migration.Toolkit.K11/Models/CiMigration.cs @@ -1,24 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsAbuseReport.cs b/Migration.Toolkit.K11/Models/CmsAbuseReport.cs index 49d5a86c..7b69bfc6 100644 --- a/Migration.Toolkit.K11/Models/CmsAbuseReport.cs +++ b/Migration.Toolkit.K11/Models/CmsAbuseReport.cs @@ -1,57 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsAcl.cs b/Migration.Toolkit.K11/Models/CmsAcl.cs index 3f033967..3d5ae6b2 100644 --- a/Migration.Toolkit.K11/Models/CmsAcl.cs +++ b/Migration.Toolkit.K11/Models/CmsAcl.cs @@ -1,39 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsAclitem.cs b/Migration.Toolkit.K11/Models/CmsAclitem.cs index 0b408e01..0ea69873 100644 --- a/Migration.Toolkit.K11/Models/CmsAclitem.cs +++ b/Migration.Toolkit.K11/Models/CmsAclitem.cs @@ -1,56 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsAlternativeForm.cs b/Migration.Toolkit.K11/Models/CmsAlternativeForm.cs index 5fcfac83..93e9f7c4 100644 --- a/Migration.Toolkit.K11/Models/CmsAlternativeForm.cs +++ b/Migration.Toolkit.K11/Models/CmsAlternativeForm.cs @@ -1,60 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsAttachment.cs b/Migration.Toolkit.K11/Models/CmsAttachment.cs index cf14d621..027fbda8 100644 --- a/Migration.Toolkit.K11/Models/CmsAttachment.cs +++ b/Migration.Toolkit.K11/Models/CmsAttachment.cs @@ -1,91 +1,91 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsAttachmentHistory.cs b/Migration.Toolkit.K11/Models/CmsAttachmentHistory.cs index d484d585..0f092767 100644 --- a/Migration.Toolkit.K11/Models/CmsAttachmentHistory.cs +++ b/Migration.Toolkit.K11/Models/CmsAttachmentHistory.cs @@ -1,90 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsAutomationHistory.cs b/Migration.Toolkit.K11/Models/CmsAutomationHistory.cs index a5593ac8..fe34b84a 100644 --- a/Migration.Toolkit.K11/Models/CmsAutomationHistory.cs +++ b/Migration.Toolkit.K11/Models/CmsAutomationHistory.cs @@ -1,82 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsAutomationState.cs b/Migration.Toolkit.K11/Models/CmsAutomationState.cs index f972918c..7e92a9f6 100644 --- a/Migration.Toolkit.K11/Models/CmsAutomationState.cs +++ b/Migration.Toolkit.K11/Models/CmsAutomationState.cs @@ -1,71 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsAvatar.cs b/Migration.Toolkit.K11/Models/CmsAvatar.cs index c70bc9cf..d077e2ed 100644 --- a/Migration.Toolkit.K11/Models/CmsAvatar.cs +++ b/Migration.Toolkit.K11/Models/CmsAvatar.cs @@ -1,61 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsBadge.cs b/Migration.Toolkit.K11/Models/CmsBadge.cs index f6ebbbe2..52a391eb 100644 --- a/Migration.Toolkit.K11/Models/CmsBadge.cs +++ b/Migration.Toolkit.K11/Models/CmsBadge.cs @@ -1,37 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsBannedIp.cs b/Migration.Toolkit.K11/Models/CmsBannedIp.cs index 70ac832b..295fe964 100644 --- a/Migration.Toolkit.K11/Models/CmsBannedIp.cs +++ b/Migration.Toolkit.K11/Models/CmsBannedIp.cs @@ -1,54 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsBanner.cs b/Migration.Toolkit.K11/Models/CmsBanner.cs index 11ad982c..643453b7 100644 --- a/Migration.Toolkit.K11/Models/CmsBanner.cs +++ b/Migration.Toolkit.K11/Models/CmsBanner.cs @@ -1,64 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsBannerCategory.cs b/Migration.Toolkit.K11/Models/CmsBannerCategory.cs index 0f73094e..0e2e78ee 100644 --- a/Migration.Toolkit.K11/Models/CmsBannerCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsBannerCategory.cs @@ -1,40 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsCategory.cs b/Migration.Toolkit.K11/Models/CmsCategory.cs index c1cf4ec0..ca74561e 100644 --- a/Migration.Toolkit.K11/Models/CmsCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsCategory.cs @@ -1,67 +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; - -[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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsClass.cs b/Migration.Toolkit.K11/Models/CmsClass.cs index 854b4071..ee945ecf 100644 --- a/Migration.Toolkit.K11/Models/CmsClass.cs +++ b/Migration.Toolkit.K11/Models/CmsClass.cs @@ -1,221 +1,221 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsConsent.cs b/Migration.Toolkit.K11/Models/CmsConsent.cs index bd1ff0a3..9435edf0 100644 --- a/Migration.Toolkit.K11/Models/CmsConsent.cs +++ b/Migration.Toolkit.K11/Models/CmsConsent.cs @@ -1,36 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsConsentAgreement.cs b/Migration.Toolkit.K11/Models/CmsConsentAgreement.cs index 913f22d8..3e83ac93 100644 --- a/Migration.Toolkit.K11/Models/CmsConsentAgreement.cs +++ b/Migration.Toolkit.K11/Models/CmsConsentAgreement.cs @@ -1,39 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsConsentArchive.cs b/Migration.Toolkit.K11/Models/CmsConsentArchive.cs index 3e5521e7..08ec5ffd 100644 --- a/Migration.Toolkit.K11/Models/CmsConsentArchive.cs +++ b/Migration.Toolkit.K11/Models/CmsConsentArchive.cs @@ -1,32 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsCountry.cs b/Migration.Toolkit.K11/Models/CmsCountry.cs index 0607b3c2..ad76454c 100644 --- a/Migration.Toolkit.K11/Models/CmsCountry.cs +++ b/Migration.Toolkit.K11/Models/CmsCountry.cs @@ -1,50 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsCssStylesheet.cs b/Migration.Toolkit.K11/Models/CmsCssStylesheet.cs index 2ca5b464..24f7af4d 100644 --- a/Migration.Toolkit.K11/Models/CmsCssStylesheet.cs +++ b/Migration.Toolkit.K11/Models/CmsCssStylesheet.cs @@ -1,50 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsCulture.cs b/Migration.Toolkit.K11/Models/CmsCulture.cs index 1fe57517..1167a4b8 100644 --- a/Migration.Toolkit.K11/Models/CmsCulture.cs +++ b/Migration.Toolkit.K11/Models/CmsCulture.cs @@ -1,61 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsDeviceProfile.cs b/Migration.Toolkit.K11/Models/CmsDeviceProfile.cs index e641a5e0..c1b8f32b 100644 --- a/Migration.Toolkit.K11/Models/CmsDeviceProfile.cs +++ b/Migration.Toolkit.K11/Models/CmsDeviceProfile.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.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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsDeviceProfileLayout.cs b/Migration.Toolkit.K11/Models/CmsDeviceProfileLayout.cs index 8e97c66f..c408085f 100644 --- a/Migration.Toolkit.K11/Models/CmsDeviceProfileLayout.cs +++ b/Migration.Toolkit.K11/Models/CmsDeviceProfileLayout.cs @@ -1,44 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsDocument.cs b/Migration.Toolkit.K11/Models/CmsDocument.cs index 617515a4..512ffa56 100644 --- a/Migration.Toolkit.K11/Models/CmsDocument.cs +++ b/Migration.Toolkit.K11/Models/CmsDocument.cs @@ -1,284 +1,284 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsDocumentAlias.cs b/Migration.Toolkit.K11/Models/CmsDocumentAlias.cs index 9516d049..bc7e018d 100644 --- a/Migration.Toolkit.K11/Models/CmsDocumentAlias.cs +++ b/Migration.Toolkit.K11/Models/CmsDocumentAlias.cs @@ -1,55 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsDocumentTypeScope.cs b/Migration.Toolkit.K11/Models/CmsDocumentTypeScope.cs index 75d44beb..0b1d2c7b 100644 --- a/Migration.Toolkit.K11/Models/CmsDocumentTypeScope.cs +++ b/Migration.Toolkit.K11/Models/CmsDocumentTypeScope.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.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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsEmail.cs b/Migration.Toolkit.K11/Models/CmsEmail.cs index 64fc1a03..a4aa4acd 100644 --- a/Migration.Toolkit.K11/Models/CmsEmail.cs +++ b/Migration.Toolkit.K11/Models/CmsEmail.cs @@ -1,69 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsEmailAttachment.cs b/Migration.Toolkit.K11/Models/CmsEmailAttachment.cs index e34d954e..cd02b37f 100644 --- a/Migration.Toolkit.K11/Models/CmsEmailAttachment.cs +++ b/Migration.Toolkit.K11/Models/CmsEmailAttachment.cs @@ -1,44 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsEmailTemplate.cs b/Migration.Toolkit.K11/Models/CmsEmailTemplate.cs index 84a8737e..94b12736 100644 --- a/Migration.Toolkit.K11/Models/CmsEmailTemplate.cs +++ b/Migration.Toolkit.K11/Models/CmsEmailTemplate.cs @@ -1,59 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsEmailUser.cs b/Migration.Toolkit.K11/Models/CmsEmailUser.cs index 4c963f91..21b5fdb8 100644 --- a/Migration.Toolkit.K11/Models/CmsEmailUser.cs +++ b/Migration.Toolkit.K11/Models/CmsEmailUser.cs @@ -1,36 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsEventLog.cs b/Migration.Toolkit.K11/Models/CmsEventLog.cs index 59465e80..4a0de4ff 100644 --- a/Migration.Toolkit.K11/Models/CmsEventLog.cs +++ b/Migration.Toolkit.K11/Models/CmsEventLog.cs @@ -1,57 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsExternalLogin.cs b/Migration.Toolkit.K11/Models/CmsExternalLogin.cs index 4f1acac1..08f25e1a 100644 --- a/Migration.Toolkit.K11/Models/CmsExternalLogin.cs +++ b/Migration.Toolkit.K11/Models/CmsExternalLogin.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsForm.cs b/Migration.Toolkit.K11/Models/CmsForm.cs index 113a2dd0..43bf1dfb 100644 --- a/Migration.Toolkit.K11/Models/CmsForm.cs +++ b/Migration.Toolkit.K11/Models/CmsForm.cs @@ -1,91 +1,91 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsFormUserControl.cs b/Migration.Toolkit.K11/Models/CmsFormUserControl.cs index efa097db..3b010661 100644 --- a/Migration.Toolkit.K11/Models/CmsFormUserControl.cs +++ b/Migration.Toolkit.K11/Models/CmsFormUserControl.cs @@ -1,109 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsHelpTopic.cs b/Migration.Toolkit.K11/Models/CmsHelpTopic.cs index aafed82a..2509c3c5 100644 --- a/Migration.Toolkit.K11/Models/CmsHelpTopic.cs +++ b/Migration.Toolkit.K11/Models/CmsHelpTopic.cs @@ -1,36 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsLayout.cs b/Migration.Toolkit.K11/Models/CmsLayout.cs index 93dddff0..df548bae 100644 --- a/Migration.Toolkit.K11/Models/CmsLayout.cs +++ b/Migration.Toolkit.K11/Models/CmsLayout.cs @@ -1,63 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsLicenseKey.cs b/Migration.Toolkit.K11/Models/CmsLicenseKey.cs index b51796d4..94678e71 100644 --- a/Migration.Toolkit.K11/Models/CmsLicenseKey.cs +++ b/Migration.Toolkit.K11/Models/CmsLicenseKey.cs @@ -1,28 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsMacroIdentity.cs b/Migration.Toolkit.K11/Models/CmsMacroIdentity.cs index d845caff..5402518b 100644 --- a/Migration.Toolkit.K11/Models/CmsMacroIdentity.cs +++ b/Migration.Toolkit.K11/Models/CmsMacroIdentity.cs @@ -1,33 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsMacroRule.cs b/Migration.Toolkit.K11/Models/CmsMacroRule.cs index 1797ee0a..19f98f64 100644 --- a/Migration.Toolkit.K11/Models/CmsMacroRule.cs +++ b/Migration.Toolkit.K11/Models/CmsMacroRule.cs @@ -1,48 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsMembership.cs b/Migration.Toolkit.K11/Models/CmsMembership.cs index 8f1f6f71..76779403 100644 --- a/Migration.Toolkit.K11/Models/CmsMembership.cs +++ b/Migration.Toolkit.K11/Models/CmsMembership.cs @@ -1,43 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsMembershipUser.cs b/Migration.Toolkit.K11/Models/CmsMembershipUser.cs index 98450040..fb1faf38 100644 --- a/Migration.Toolkit.K11/Models/CmsMembershipUser.cs +++ b/Migration.Toolkit.K11/Models/CmsMembershipUser.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsMetaFile.cs b/Migration.Toolkit.K11/Models/CmsMetaFile.cs index 97b60ad3..fcc82227 100644 --- a/Migration.Toolkit.K11/Models/CmsMetaFile.cs +++ b/Migration.Toolkit.K11/Models/CmsMetaFile.cs @@ -1,62 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsModuleLicenseKey.cs b/Migration.Toolkit.K11/Models/CmsModuleLicenseKey.cs index d066efd5..14c06f8b 100644 --- a/Migration.Toolkit.K11/Models/CmsModuleLicenseKey.cs +++ b/Migration.Toolkit.K11/Models/CmsModuleLicenseKey.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsModuleUsageCounter.cs b/Migration.Toolkit.K11/Models/CmsModuleUsageCounter.cs index 325b7e32..5d92d286 100644 --- a/Migration.Toolkit.K11/Models/CmsModuleUsageCounter.cs +++ b/Migration.Toolkit.K11/Models/CmsModuleUsageCounter.cs @@ -1,20 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsObjectSetting.cs b/Migration.Toolkit.K11/Models/CmsObjectSetting.cs index 83bb1c06..ff800c0e 100644 --- a/Migration.Toolkit.K11/Models/CmsObjectSetting.cs +++ b/Migration.Toolkit.K11/Models/CmsObjectSetting.cs @@ -1,62 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsObjectVersionHistory.cs b/Migration.Toolkit.K11/Models/CmsObjectVersionHistory.cs index b9a8c5e5..544e37fe 100644 --- a/Migration.Toolkit.K11/Models/CmsObjectVersionHistory.cs +++ b/Migration.Toolkit.K11/Models/CmsObjectVersionHistory.cs @@ -1,73 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.K11/Models/CmsObjectWorkflowTrigger.cs index c5eae38e..39fa1d50 100644 --- a/Migration.Toolkit.K11/Models/CmsObjectWorkflowTrigger.cs +++ b/Migration.Toolkit.K11/Models/CmsObjectWorkflowTrigger.cs @@ -1,46 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsOpenIduser.cs b/Migration.Toolkit.K11/Models/CmsOpenIduser.cs index b4706336..6bc7962b 100644 --- a/Migration.Toolkit.K11/Models/CmsOpenIduser.cs +++ b/Migration.Toolkit.K11/Models/CmsOpenIduser.cs @@ -1,31 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsPageTemplate.cs b/Migration.Toolkit.K11/Models/CmsPageTemplate.cs index 4aed210b..2edf0752 100644 --- a/Migration.Toolkit.K11/Models/CmsPageTemplate.cs +++ b/Migration.Toolkit.K11/Models/CmsPageTemplate.cs @@ -1,142 +1,142 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsPageTemplateCategory.cs b/Migration.Toolkit.K11/Models/CmsPageTemplateCategory.cs index 730fb978..b3cfb553 100644 --- a/Migration.Toolkit.K11/Models/CmsPageTemplateCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsPageTemplateCategory.cs @@ -1,55 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsPageTemplateScope.cs b/Migration.Toolkit.K11/Models/CmsPageTemplateScope.cs index 42e0c354..465891c0 100644 --- a/Migration.Toolkit.K11/Models/CmsPageTemplateScope.cs +++ b/Migration.Toolkit.K11/Models/CmsPageTemplateScope.cs @@ -1,57 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsPermission.cs b/Migration.Toolkit.K11/Models/CmsPermission.cs index 630b9291..74584270 100644 --- a/Migration.Toolkit.K11/Models/CmsPermission.cs +++ b/Migration.Toolkit.K11/Models/CmsPermission.cs @@ -1,66 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsPersonalization.cs b/Migration.Toolkit.K11/Models/CmsPersonalization.cs index e1c5b128..924d6bf2 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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsQuery.cs b/Migration.Toolkit.K11/Models/CmsQuery.cs index e94bbdb7..5632ca1c 100644 --- a/Migration.Toolkit.K11/Models/CmsQuery.cs +++ b/Migration.Toolkit.K11/Models/CmsQuery.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.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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsRelationship.cs b/Migration.Toolkit.K11/Models/CmsRelationship.cs index a6640e07..6ab0f8cc 100644 --- a/Migration.Toolkit.K11/Models/CmsRelationship.cs +++ b/Migration.Toolkit.K11/Models/CmsRelationship.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.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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsRelationshipName.cs b/Migration.Toolkit.K11/Models/CmsRelationshipName.cs index bdb57e34..5edf9012 100644 --- a/Migration.Toolkit.K11/Models/CmsRelationshipName.cs +++ b/Migration.Toolkit.K11/Models/CmsRelationshipName.cs @@ -1,39 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsResource.cs b/Migration.Toolkit.K11/Models/CmsResource.cs index 28fd8655..27ddef4c 100644 --- a/Migration.Toolkit.K11/Models/CmsResource.cs +++ b/Migration.Toolkit.K11/Models/CmsResource.cs @@ -1,85 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsResourceLibrary.cs b/Migration.Toolkit.K11/Models/CmsResourceLibrary.cs index f9cdc1a4..27ff7b32 100644 --- a/Migration.Toolkit.K11/Models/CmsResourceLibrary.cs +++ b/Migration.Toolkit.K11/Models/CmsResourceLibrary.cs @@ -1,26 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsResourceString.cs b/Migration.Toolkit.K11/Models/CmsResourceString.cs index 6e53f583..8f7916c9 100644 --- a/Migration.Toolkit.K11/Models/CmsResourceString.cs +++ b/Migration.Toolkit.K11/Models/CmsResourceString.cs @@ -1,27 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsResourceTranslation.cs b/Migration.Toolkit.K11/Models/CmsResourceTranslation.cs index a02ac56d..9c3033dd 100644 --- a/Migration.Toolkit.K11/Models/CmsResourceTranslation.cs +++ b/Migration.Toolkit.K11/Models/CmsResourceTranslation.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsRole.cs b/Migration.Toolkit.K11/Models/CmsRole.cs index 990c248f..4f4b1c69 100644 --- a/Migration.Toolkit.K11/Models/CmsRole.cs +++ b/Migration.Toolkit.K11/Models/CmsRole.cs @@ -1,98 +1,98 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsScheduledTask.cs b/Migration.Toolkit.K11/Models/CmsScheduledTask.cs index 47f35f08..0fc4e7cc 100644 --- a/Migration.Toolkit.K11/Models/CmsScheduledTask.cs +++ b/Migration.Toolkit.K11/Models/CmsScheduledTask.cs @@ -1,112 +1,112 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsSearchEngine.cs b/Migration.Toolkit.K11/Models/CmsSearchEngine.cs index bb3933b7..0c5ef343 100644 --- a/Migration.Toolkit.K11/Models/CmsSearchEngine.cs +++ b/Migration.Toolkit.K11/Models/CmsSearchEngine.cs @@ -1,35 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsSearchIndex.cs b/Migration.Toolkit.K11/Models/CmsSearchIndex.cs index 8ce7f49d..f6ec1dea 100644 --- a/Migration.Toolkit.K11/Models/CmsSearchIndex.cs +++ b/Migration.Toolkit.K11/Models/CmsSearchIndex.cs @@ -1,88 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsSearchTask.cs b/Migration.Toolkit.K11/Models/CmsSearchTask.cs index 4a3d4828..a268f8a5 100644 --- a/Migration.Toolkit.K11/Models/CmsSearchTask.cs +++ b/Migration.Toolkit.K11/Models/CmsSearchTask.cs @@ -1,42 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsSearchTaskAzure.cs b/Migration.Toolkit.K11/Models/CmsSearchTaskAzure.cs index b103b059..da25189f 100644 --- a/Migration.Toolkit.K11/Models/CmsSearchTaskAzure.cs +++ b/Migration.Toolkit.K11/Models/CmsSearchTaskAzure.cs @@ -1,37 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsSession.cs b/Migration.Toolkit.K11/Models/CmsSession.cs index f2a1eb2b..cb79580f 100644 --- a/Migration.Toolkit.K11/Models/CmsSession.cs +++ b/Migration.Toolkit.K11/Models/CmsSession.cs @@ -1,66 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsSettingsCategory.cs b/Migration.Toolkit.K11/Models/CmsSettingsCategory.cs index 0cea2075..0c2b61cb 100644 --- a/Migration.Toolkit.K11/Models/CmsSettingsCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsSettingsCategory.cs @@ -1,60 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsSettingsKey.cs b/Migration.Toolkit.K11/Models/CmsSettingsKey.cs index 97fbb8fe..04c7dd66 100644 --- a/Migration.Toolkit.K11/Models/CmsSettingsKey.cs +++ b/Migration.Toolkit.K11/Models/CmsSettingsKey.cs @@ -1,69 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsSite.cs b/Migration.Toolkit.K11/Models/CmsSite.cs index d8535754..7361480f 100644 --- a/Migration.Toolkit.K11/Models/CmsSite.cs +++ b/Migration.Toolkit.K11/Models/CmsSite.cs @@ -1,408 +1,408 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsSiteDomainAlias.cs b/Migration.Toolkit.K11/Models/CmsSiteDomainAlias.cs index 5b554dff..61970d96 100644 --- a/Migration.Toolkit.K11/Models/CmsSiteDomainAlias.cs +++ b/Migration.Toolkit.K11/Models/CmsSiteDomainAlias.cs @@ -1,41 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsSmtpserver.cs b/Migration.Toolkit.K11/Models/CmsSmtpserver.cs index 75826b05..8d51a3ed 100644 --- a/Migration.Toolkit.K11/Models/CmsSmtpserver.cs +++ b/Migration.Toolkit.K11/Models/CmsSmtpserver.cs @@ -1,47 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsState.cs b/Migration.Toolkit.K11/Models/CmsState.cs index 5c12dcdc..b0987fcb 100644 --- a/Migration.Toolkit.K11/Models/CmsState.cs +++ b/Migration.Toolkit.K11/Models/CmsState.cs @@ -1,53 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsTag.cs b/Migration.Toolkit.K11/Models/CmsTag.cs index e2f57c1b..f4158825 100644 --- a/Migration.Toolkit.K11/Models/CmsTag.cs +++ b/Migration.Toolkit.K11/Models/CmsTag.cs @@ -1,35 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsTagGroup.cs b/Migration.Toolkit.K11/Models/CmsTagGroup.cs index 55508a7c..d25b80ad 100644 --- a/Migration.Toolkit.K11/Models/CmsTagGroup.cs +++ b/Migration.Toolkit.K11/Models/CmsTagGroup.cs @@ -1,44 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsTemplateDeviceLayout.cs b/Migration.Toolkit.K11/Models/CmsTemplateDeviceLayout.cs index 20647839..6bff5704 100644 --- a/Migration.Toolkit.K11/Models/CmsTemplateDeviceLayout.cs +++ b/Migration.Toolkit.K11/Models/CmsTemplateDeviceLayout.cs @@ -1,56 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsTimeZone.cs b/Migration.Toolkit.K11/Models/CmsTimeZone.cs index 61b415a5..f1322ceb 100644 --- a/Migration.Toolkit.K11/Models/CmsTimeZone.cs +++ b/Migration.Toolkit.K11/Models/CmsTimeZone.cs @@ -1,44 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsTransformation.cs b/Migration.Toolkit.K11/Models/CmsTransformation.cs index 2a1f7128..7283cddc 100644 --- a/Migration.Toolkit.K11/Models/CmsTransformation.cs +++ b/Migration.Toolkit.K11/Models/CmsTransformation.cs @@ -1,51 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsTranslationService.cs b/Migration.Toolkit.K11/Models/CmsTranslationService.cs index dd8ec69b..29871da0 100644 --- a/Migration.Toolkit.K11/Models/CmsTranslationService.cs +++ b/Migration.Toolkit.K11/Models/CmsTranslationService.cs @@ -1,54 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsTranslationSubmission.cs b/Migration.Toolkit.K11/Models/CmsTranslationSubmission.cs index f378c66c..1fd8c680 100644 --- a/Migration.Toolkit.K11/Models/CmsTranslationSubmission.cs +++ b/Migration.Toolkit.K11/Models/CmsTranslationSubmission.cs @@ -1,76 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsTranslationSubmissionItem.cs b/Migration.Toolkit.K11/Models/CmsTranslationSubmissionItem.cs index 9b1d5182..15a7f688 100644 --- a/Migration.Toolkit.K11/Models/CmsTranslationSubmissionItem.cs +++ b/Migration.Toolkit.K11/Models/CmsTranslationSubmissionItem.cs @@ -1,58 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsTree.cs b/Migration.Toolkit.K11/Models/CmsTree.cs index cd99c658..c587b2f9 100644 --- a/Migration.Toolkit.K11/Models/CmsTree.cs +++ b/Migration.Toolkit.K11/Models/CmsTree.cs @@ -1,184 +1,184 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsUielement.cs b/Migration.Toolkit.K11/Models/CmsUielement.cs index 4954cac3..8cfada8a 100644 --- a/Migration.Toolkit.K11/Models/CmsUielement.cs +++ b/Migration.Toolkit.K11/Models/CmsUielement.cs @@ -1,116 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsUser.cs b/Migration.Toolkit.K11/Models/CmsUser.cs index 1e86c051..336bafe0 100644 --- a/Migration.Toolkit.K11/Models/CmsUser.cs +++ b/Migration.Toolkit.K11/Models/CmsUser.cs @@ -1,340 +1,340 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsUserCulture.cs b/Migration.Toolkit.K11/Models/CmsUserCulture.cs index 36171179..82ef7693 100644 --- a/Migration.Toolkit.K11/Models/CmsUserCulture.cs +++ b/Migration.Toolkit.K11/Models/CmsUserCulture.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.K11/Models/CmsUserMacroIdentity.cs index 6102c7f8..400b0abe 100644 --- a/Migration.Toolkit.K11/Models/CmsUserMacroIdentity.cs +++ b/Migration.Toolkit.K11/Models/CmsUserMacroIdentity.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsUserRole.cs b/Migration.Toolkit.K11/Models/CmsUserRole.cs index 4c3f03c3..299c1e95 100644 --- a/Migration.Toolkit.K11/Models/CmsUserRole.cs +++ b/Migration.Toolkit.K11/Models/CmsUserRole.cs @@ -1,34 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsUserSetting.cs b/Migration.Toolkit.K11/Models/CmsUserSetting.cs index 27332f7c..b4b858a4 100644 --- a/Migration.Toolkit.K11/Models/CmsUserSetting.cs +++ b/Migration.Toolkit.K11/Models/CmsUserSetting.cs @@ -1,171 +1,171 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsUserSite.cs b/Migration.Toolkit.K11/Models/CmsUserSite.cs index e87edf54..cd67c5ed 100644 --- a/Migration.Toolkit.K11/Models/CmsUserSite.cs +++ b/Migration.Toolkit.K11/Models/CmsUserSite.cs @@ -1,31 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsVersionHistory.cs b/Migration.Toolkit.K11/Models/CmsVersionHistory.cs index 9b0d4efd..0ac0f7d1 100644 --- a/Migration.Toolkit.K11/Models/CmsVersionHistory.cs +++ b/Migration.Toolkit.K11/Models/CmsVersionHistory.cs @@ -1,117 +1,117 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServer.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServer.cs index d29c912d..a2637962 100644 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServer.cs +++ b/Migration.Toolkit.K11/Models/CmsWebFarmServer.cs @@ -1,34 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServerLog.cs index fc00ae4e..f8f5a419 100644 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServerLog.cs +++ b/Migration.Toolkit.K11/Models/CmsWebFarmServerLog.cs @@ -1,23 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServerMonitoring.cs index 6b4fa203..19613450 100644 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServerMonitoring.cs +++ b/Migration.Toolkit.K11/Models/CmsWebFarmServerMonitoring.cs @@ -1,20 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServerTask.cs index 70b423b6..fa5f285d 100644 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServerTask.cs +++ b/Migration.Toolkit.K11/Models/CmsWebFarmServerTask.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmTask.cs b/Migration.Toolkit.K11/Models/CmsWebFarmTask.cs index a287b32e..fd3bd764 100644 --- a/Migration.Toolkit.K11/Models/CmsWebFarmTask.cs +++ b/Migration.Toolkit.K11/Models/CmsWebFarmTask.cs @@ -1,42 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWebPart.cs b/Migration.Toolkit.K11/Models/CmsWebPart.cs index b896533a..a16cbeee 100644 --- a/Migration.Toolkit.K11/Models/CmsWebPart.cs +++ b/Migration.Toolkit.K11/Models/CmsWebPart.cs @@ -1,86 +1,86 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWebPartCategory.cs b/Migration.Toolkit.K11/Models/CmsWebPartCategory.cs index 7fec6117..863ec020 100644 --- a/Migration.Toolkit.K11/Models/CmsWebPartCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsWebPartCategory.cs @@ -1,51 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWebPartContainer.cs b/Migration.Toolkit.K11/Models/CmsWebPartContainer.cs index f9e65db4..9a68f93e 100644 --- a/Migration.Toolkit.K11/Models/CmsWebPartContainer.cs +++ b/Migration.Toolkit.K11/Models/CmsWebPartContainer.cs @@ -1,38 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWebPartLayout.cs b/Migration.Toolkit.K11/Models/CmsWebPartLayout.cs index 603d082b..3e7af7c9 100644 --- a/Migration.Toolkit.K11/Models/CmsWebPartLayout.cs +++ b/Migration.Toolkit.K11/Models/CmsWebPartLayout.cs @@ -1,50 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWebTemplate.cs b/Migration.Toolkit.K11/Models/CmsWebTemplate.cs index ba78915d..57ef216f 100644 --- a/Migration.Toolkit.K11/Models/CmsWebTemplate.cs +++ b/Migration.Toolkit.K11/Models/CmsWebTemplate.cs @@ -1,41 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWidget.cs b/Migration.Toolkit.K11/Models/CmsWidget.cs index d34313ae..f6928baa 100644 --- a/Migration.Toolkit.K11/Models/CmsWidget.cs +++ b/Migration.Toolkit.K11/Models/CmsWidget.cs @@ -1,84 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWidgetCategory.cs b/Migration.Toolkit.K11/Models/CmsWidgetCategory.cs index 9172606a..b021934f 100644 --- a/Migration.Toolkit.K11/Models/CmsWidgetCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsWidgetCategory.cs @@ -1,51 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWidgetRole.cs b/Migration.Toolkit.K11/Models/CmsWidgetRole.cs index c294fc3e..1869d660 100644 --- a/Migration.Toolkit.K11/Models/CmsWidgetRole.cs +++ b/Migration.Toolkit.K11/Models/CmsWidgetRole.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWorkflow.cs b/Migration.Toolkit.K11/Models/CmsWorkflow.cs index 1c07f0ad..771e173c 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflow.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflow.cs @@ -1,96 +1,96 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowAction.cs b/Migration.Toolkit.K11/Models/CmsWorkflowAction.cs index 67ae8175..a01b7521 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowAction.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowAction.cs @@ -1,66 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowHistory.cs b/Migration.Toolkit.K11/Models/CmsWorkflowHistory.cs index ee165cef..f7d119f0 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowHistory.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowHistory.cs @@ -1,88 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowScope.cs b/Migration.Toolkit.K11/Models/CmsWorkflowScope.cs index 723868c7..adc175eb 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowScope.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowScope.cs @@ -1,60 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowStep.cs b/Migration.Toolkit.K11/Models/CmsWorkflowStep.cs index 773dc3d5..52f448bc 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowStep.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowStep.cs @@ -1,115 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowStepRole.cs b/Migration.Toolkit.K11/Models/CmsWorkflowStepRole.cs index 745ffaf9..4881eb00 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowStepRole.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowStepRole.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowStepUser.cs b/Migration.Toolkit.K11/Models/CmsWorkflowStepUser.cs index 2b92e6bd..ccc72d21 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowStepUser.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowStepUser.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.K11/Models/CmsWorkflowTransition.cs index eca21feb..26ac7346 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowTransition.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowTransition.cs @@ -1,46 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComAddress.cs b/Migration.Toolkit.K11/Models/ComAddress.cs index 213516c8..99fd8020 100644 --- a/Migration.Toolkit.K11/Models/ComAddress.cs +++ b/Migration.Toolkit.K11/Models/ComAddress.cs @@ -1,74 +1,74 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ComBrand.cs b/Migration.Toolkit.K11/Models/ComBrand.cs index fc5eaab6..faa33c2b 100644 --- a/Migration.Toolkit.K11/Models/ComBrand.cs +++ b/Migration.Toolkit.K11/Models/ComBrand.cs @@ -1,51 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ComCarrier.cs b/Migration.Toolkit.K11/Models/ComCarrier.cs index 5720b570..a8cea85c 100644 --- a/Migration.Toolkit.K11/Models/ComCarrier.cs +++ b/Migration.Toolkit.K11/Models/ComCarrier.cs @@ -1,43 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ComCollection.cs b/Migration.Toolkit.K11/Models/ComCollection.cs index 80c3f596..2efb10e1 100644 --- a/Migration.Toolkit.K11/Models/ComCollection.cs +++ b/Migration.Toolkit.K11/Models/ComCollection.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.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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ComCouponCode.cs b/Migration.Toolkit.K11/Models/ComCouponCode.cs index c5557461..d5f0389f 100644 --- a/Migration.Toolkit.K11/Models/ComCouponCode.cs +++ b/Migration.Toolkit.K11/Models/ComCouponCode.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComCurrency.cs b/Migration.Toolkit.K11/Models/ComCurrency.cs index a392c36c..33b20659 100644 --- a/Migration.Toolkit.K11/Models/ComCurrency.cs +++ b/Migration.Toolkit.K11/Models/ComCurrency.cs @@ -1,56 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComCurrencyExchangeRate.cs b/Migration.Toolkit.K11/Models/ComCurrencyExchangeRate.cs index bdf91565..6a09c84c 100644 --- a/Migration.Toolkit.K11/Models/ComCurrencyExchangeRate.cs +++ b/Migration.Toolkit.K11/Models/ComCurrencyExchangeRate.cs @@ -1,39 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComCustomer.cs b/Migration.Toolkit.K11/Models/ComCustomer.cs index 36b742b3..cef89bac 100644 --- a/Migration.Toolkit.K11/Models/ComCustomer.cs +++ b/Migration.Toolkit.K11/Models/ComCustomer.cs @@ -1,79 +1,79 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComCustomerCreditHistory.cs b/Migration.Toolkit.K11/Models/ComCustomerCreditHistory.cs index 041d59cc..54870410 100644 --- a/Migration.Toolkit.K11/Models/ComCustomerCreditHistory.cs +++ b/Migration.Toolkit.K11/Models/ComCustomerCreditHistory.cs @@ -1,46 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComDepartment.cs b/Migration.Toolkit.K11/Models/ComDepartment.cs index 9f4caef3..22a8f799 100644 --- a/Migration.Toolkit.K11/Models/ComDepartment.cs +++ b/Migration.Toolkit.K11/Models/ComDepartment.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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ComDiscount.cs b/Migration.Toolkit.K11/Models/ComDiscount.cs index 7deef208..c4b11e11 100644 --- a/Migration.Toolkit.K11/Models/ComDiscount.cs +++ b/Migration.Toolkit.K11/Models/ComDiscount.cs @@ -1,74 +1,74 @@ -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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComExchangeTable.cs b/Migration.Toolkit.K11/Models/ComExchangeTable.cs index 97b71e75..016aff0c 100644 --- a/Migration.Toolkit.K11/Models/ComExchangeTable.cs +++ b/Migration.Toolkit.K11/Models/ComExchangeTable.cs @@ -1,41 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComGiftCard.cs b/Migration.Toolkit.K11/Models/ComGiftCard.cs index 1e89ce36..9b61b520 100644 --- a/Migration.Toolkit.K11/Models/ComGiftCard.cs +++ b/Migration.Toolkit.K11/Models/ComGiftCard.cs @@ -1,59 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComGiftCardCouponCode.cs b/Migration.Toolkit.K11/Models/ComGiftCardCouponCode.cs index 701278fd..63551ba8 100644 --- a/Migration.Toolkit.K11/Models/ComGiftCardCouponCode.cs +++ b/Migration.Toolkit.K11/Models/ComGiftCardCouponCode.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComInternalStatus.cs b/Migration.Toolkit.K11/Models/ComInternalStatus.cs index 0a5bd1c5..3153a88e 100644 --- a/Migration.Toolkit.K11/Models/ComInternalStatus.cs +++ b/Migration.Toolkit.K11/Models/ComInternalStatus.cs @@ -1,40 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComManufacturer.cs b/Migration.Toolkit.K11/Models/ComManufacturer.cs index 797f89a0..d9e4b7d4 100644 --- a/Migration.Toolkit.K11/Models/ComManufacturer.cs +++ b/Migration.Toolkit.K11/Models/ComManufacturer.cs @@ -1,48 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyCouponCode.cs b/Migration.Toolkit.K11/Models/ComMultiBuyCouponCode.cs index df798b4c..0df480f2 100644 --- a/Migration.Toolkit.K11/Models/ComMultiBuyCouponCode.cs +++ b/Migration.Toolkit.K11/Models/ComMultiBuyCouponCode.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscount.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscount.cs index 9f5d4c7c..22d90796 100644 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscount.cs +++ b/Migration.Toolkit.K11/Models/ComMultiBuyDiscount.cs @@ -1,98 +1,98 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountBrand.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountBrand.cs index 042b9f7a..e73d711e 100644 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountBrand.cs +++ b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountBrand.cs @@ -1,32 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountCollection.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountCollection.cs index 1981f22c..091075b8 100644 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountCollection.cs +++ b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountCollection.cs @@ -1,32 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountTree.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountTree.cs index 9da5160d..b7e03232 100644 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountTree.cs +++ b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountTree.cs @@ -1,32 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComOptionCategory.cs b/Migration.Toolkit.K11/Models/ComOptionCategory.cs index d25b9785..91d1aeff 100644 --- a/Migration.Toolkit.K11/Models/ComOptionCategory.cs +++ b/Migration.Toolkit.K11/Models/ComOptionCategory.cs @@ -1,66 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ComOrder.cs b/Migration.Toolkit.K11/Models/ComOrder.cs index 87731aa7..d1657540 100644 --- a/Migration.Toolkit.K11/Models/ComOrder.cs +++ b/Migration.Toolkit.K11/Models/ComOrder.cs @@ -1,153 +1,153 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComOrderAddress.cs b/Migration.Toolkit.K11/Models/ComOrderAddress.cs index c4c7fdcb..f330b6af 100644 --- a/Migration.Toolkit.K11/Models/ComOrderAddress.cs +++ b/Migration.Toolkit.K11/Models/ComOrderAddress.cs @@ -1,63 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ComOrderItem.cs b/Migration.Toolkit.K11/Models/ComOrderItem.cs index d6811d19..5b4f96d1 100644 --- a/Migration.Toolkit.K11/Models/ComOrderItem.cs +++ b/Migration.Toolkit.K11/Models/ComOrderItem.cs @@ -1,70 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComOrderItemSkufile.cs b/Migration.Toolkit.K11/Models/ComOrderItemSkufile.cs index 5a68d588..99536797 100644 --- a/Migration.Toolkit.K11/Models/ComOrderItemSkufile.cs +++ b/Migration.Toolkit.K11/Models/ComOrderItemSkufile.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComOrderStatus.cs b/Migration.Toolkit.K11/Models/ComOrderStatus.cs index e9866162..8f86b30e 100644 --- a/Migration.Toolkit.K11/Models/ComOrderStatus.cs +++ b/Migration.Toolkit.K11/Models/ComOrderStatus.cs @@ -1,64 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComOrderStatusUser.cs b/Migration.Toolkit.K11/Models/ComOrderStatusUser.cs index d8b5dad2..7ae4be14 100644 --- a/Migration.Toolkit.K11/Models/ComOrderStatusUser.cs +++ b/Migration.Toolkit.K11/Models/ComOrderStatusUser.cs @@ -1,51 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComPaymentOption.cs b/Migration.Toolkit.K11/Models/ComPaymentOption.cs index 4d52004b..23f8f5ed 100644 --- a/Migration.Toolkit.K11/Models/ComPaymentOption.cs +++ b/Migration.Toolkit.K11/Models/ComPaymentOption.cs @@ -1,83 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComPublicStatus.cs b/Migration.Toolkit.K11/Models/ComPublicStatus.cs index eebaf544..2538856c 100644 --- a/Migration.Toolkit.K11/Models/ComPublicStatus.cs +++ b/Migration.Toolkit.K11/Models/ComPublicStatus.cs @@ -1,40 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComShippingCost.cs b/Migration.Toolkit.K11/Models/ComShippingCost.cs index a126c35e..0fceb818 100644 --- a/Migration.Toolkit.K11/Models/ComShippingCost.cs +++ b/Migration.Toolkit.K11/Models/ComShippingCost.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComShippingOption.cs b/Migration.Toolkit.K11/Models/ComShippingOption.cs index f8962811..9081845d 100644 --- a/Migration.Toolkit.K11/Models/ComShippingOption.cs +++ b/Migration.Toolkit.K11/Models/ComShippingOption.cs @@ -1,70 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComShoppingCart.cs b/Migration.Toolkit.K11/Models/ComShoppingCart.cs index 70f5b31c..1947172d 100644 --- a/Migration.Toolkit.K11/Models/ComShoppingCart.cs +++ b/Migration.Toolkit.K11/Models/ComShoppingCart.cs @@ -1,107 +1,107 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComShoppingCartCouponCode.cs b/Migration.Toolkit.K11/Models/ComShoppingCartCouponCode.cs index 2f77f11f..ae8fa422 100644 --- a/Migration.Toolkit.K11/Models/ComShoppingCartCouponCode.cs +++ b/Migration.Toolkit.K11/Models/ComShoppingCartCouponCode.cs @@ -1,26 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComShoppingCartSku.cs b/Migration.Toolkit.K11/Models/ComShoppingCartSku.cs index ac8625ac..962cb678 100644 --- a/Migration.Toolkit.K11/Models/ComShoppingCartSku.cs +++ b/Migration.Toolkit.K11/Models/ComShoppingCartSku.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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComSku.cs b/Migration.Toolkit.K11/Models/ComSku.cs index 71b26053..f5136417 100644 --- a/Migration.Toolkit.K11/Models/ComSku.cs +++ b/Migration.Toolkit.K11/Models/ComSku.cs @@ -1,278 +1,278 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ComSkufile.cs b/Migration.Toolkit.K11/Models/ComSkufile.cs index ae70d855..c22f0a77 100644 --- a/Migration.Toolkit.K11/Models/ComSkufile.cs +++ b/Migration.Toolkit.K11/Models/ComSkufile.cs @@ -1,43 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComSkuoptionCategory.cs b/Migration.Toolkit.K11/Models/ComSkuoptionCategory.cs index 3acf2755..700fe03d 100644 --- a/Migration.Toolkit.K11/Models/ComSkuoptionCategory.cs +++ b/Migration.Toolkit.K11/Models/ComSkuoptionCategory.cs @@ -1,36 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComSupplier.cs b/Migration.Toolkit.K11/Models/ComSupplier.cs index 590cdf8a..b23eba29 100644 --- a/Migration.Toolkit.K11/Models/ComSupplier.cs +++ b/Migration.Toolkit.K11/Models/ComSupplier.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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComTaxClass.cs b/Migration.Toolkit.K11/Models/ComTaxClass.cs index 0be24775..c84fb883 100644 --- a/Migration.Toolkit.K11/Models/ComTaxClass.cs +++ b/Migration.Toolkit.K11/Models/ComTaxClass.cs @@ -1,52 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ComTaxClassCountry.cs b/Migration.Toolkit.K11/Models/ComTaxClassCountry.cs index 84224314..97be5f44 100644 --- a/Migration.Toolkit.K11/Models/ComTaxClassCountry.cs +++ b/Migration.Toolkit.K11/Models/ComTaxClassCountry.cs @@ -1,34 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComTaxClassState.cs b/Migration.Toolkit.K11/Models/ComTaxClassState.cs index 195ecb06..fd1a6ac2 100644 --- a/Migration.Toolkit.K11/Models/ComTaxClassState.cs +++ b/Migration.Toolkit.K11/Models/ComTaxClassState.cs @@ -1,34 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComVolumeDiscount.cs b/Migration.Toolkit.K11/Models/ComVolumeDiscount.cs index e1c46abf..5ba13111 100644 --- a/Migration.Toolkit.K11/Models/ComVolumeDiscount.cs +++ b/Migration.Toolkit.K11/Models/ComVolumeDiscount.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ComWishlist.cs b/Migration.Toolkit.K11/Models/ComWishlist.cs index 0ee33a02..9b4e0e1d 100644 --- a/Migration.Toolkit.K11/Models/ComWishlist.cs +++ b/Migration.Toolkit.K11/Models/ComWishlist.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CommunityFriend.cs b/Migration.Toolkit.K11/Models/CommunityFriend.cs index 1853672a..527c77ec 100644 --- a/Migration.Toolkit.K11/Models/CommunityFriend.cs +++ b/Migration.Toolkit.K11/Models/CommunityFriend.cs @@ -1,59 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CommunityGroup.cs b/Migration.Toolkit.K11/Models/CommunityGroup.cs index 38948680..156dfa11 100644 --- a/Migration.Toolkit.K11/Models/CommunityGroup.cs +++ b/Migration.Toolkit.K11/Models/CommunityGroup.cs @@ -1,110 +1,110 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/CommunityGroupMember.cs b/Migration.Toolkit.K11/Models/CommunityGroupMember.cs index 04f5623f..5684378f 100644 --- a/Migration.Toolkit.K11/Models/CommunityGroupMember.cs +++ b/Migration.Toolkit.K11/Models/CommunityGroupMember.cs @@ -1,61 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CommunityGroupRolePermission.cs b/Migration.Toolkit.K11/Models/CommunityGroupRolePermission.cs index 478d7935..9a190a36 100644 --- a/Migration.Toolkit.K11/Models/CommunityGroupRolePermission.cs +++ b/Migration.Toolkit.K11/Models/CommunityGroupRolePermission.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/CommunityInvitation.cs b/Migration.Toolkit.K11/Models/CommunityInvitation.cs index 307a7f78..9683b3bd 100644 --- a/Migration.Toolkit.K11/Models/CommunityInvitation.cs +++ b/Migration.Toolkit.K11/Models/CommunityInvitation.cs @@ -1,53 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentArticle.cs b/Migration.Toolkit.K11/Models/ContentArticle.cs index 2330ddaa..1ffe1318 100644 --- a/Migration.Toolkit.K11/Models/ContentArticle.cs +++ b/Migration.Toolkit.K11/Models/ContentArticle.cs @@ -1,24 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentBlog.cs b/Migration.Toolkit.K11/Models/ContentBlog.cs index dcfb24cb..e40659a7 100644 --- a/Migration.Toolkit.K11/Models/ContentBlog.cs +++ b/Migration.Toolkit.K11/Models/ContentBlog.cs @@ -1,57 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentBlogMonth.cs b/Migration.Toolkit.K11/Models/ContentBlogMonth.cs index 8dc15b15..d73a662a 100644 --- a/Migration.Toolkit.K11/Models/ContentBlogMonth.cs +++ b/Migration.Toolkit.K11/Models/ContentBlogMonth.cs @@ -1,20 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentBlogPost.cs b/Migration.Toolkit.K11/Models/ContentBlogPost.cs index a47e314b..7d698856 100644 --- a/Migration.Toolkit.K11/Models/ContentBlogPost.cs +++ b/Migration.Toolkit.K11/Models/ContentBlogPost.cs @@ -1,38 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentBookingEvent.cs b/Migration.Toolkit.K11/Models/ContentBookingEvent.cs index 9f86e52d..21be3d9b 100644 --- a/Migration.Toolkit.K11/Models/ContentBookingEvent.cs +++ b/Migration.Toolkit.K11/Models/ContentBookingEvent.cs @@ -1,40 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentCellphone.cs b/Migration.Toolkit.K11/Models/ContentCellphone.cs index 60dcdda0..0a48b759 100644 --- a/Migration.Toolkit.K11/Models/ContentCellphone.cs +++ b/Migration.Toolkit.K11/Models/ContentCellphone.cs @@ -1,50 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentEbook.cs b/Migration.Toolkit.K11/Models/ContentEbook.cs index 328df3e8..a8af10f9 100644 --- a/Migration.Toolkit.K11/Models/ContentEbook.cs +++ b/Migration.Toolkit.K11/Models/ContentEbook.cs @@ -1,24 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentEvent.cs b/Migration.Toolkit.K11/Models/ContentEvent.cs index 99bf4180..3468f390 100644 --- a/Migration.Toolkit.K11/Models/ContentEvent.cs +++ b/Migration.Toolkit.K11/Models/ContentEvent.cs @@ -1,26 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentFaq.cs b/Migration.Toolkit.K11/Models/ContentFaq.cs index f32d0ccd..87652425 100644 --- a/Migration.Toolkit.K11/Models/ContentFaq.cs +++ b/Migration.Toolkit.K11/Models/ContentFaq.cs @@ -1,22 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentFile.cs b/Migration.Toolkit.K11/Models/ContentFile.cs index 341ab357..91da1bf4 100644 --- a/Migration.Toolkit.K11/Models/ContentFile.cs +++ b/Migration.Toolkit.K11/Models/ContentFile.cs @@ -1,23 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentHeadlineBanner.cs b/Migration.Toolkit.K11/Models/ContentHeadlineBanner.cs index 48cde3ef..082c88fe 100644 --- a/Migration.Toolkit.K11/Models/ContentHeadlineBanner.cs +++ b/Migration.Toolkit.K11/Models/ContentHeadlineBanner.cs @@ -1,24 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentImageGallery.cs b/Migration.Toolkit.K11/Models/ContentImageGallery.cs index 6f0237ec..82691eef 100644 --- a/Migration.Toolkit.K11/Models/ContentImageGallery.cs +++ b/Migration.Toolkit.K11/Models/ContentImageGallery.cs @@ -1,22 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentJob.cs b/Migration.Toolkit.K11/Models/ContentJob.cs index cd9b5952..5d3d4387 100644 --- a/Migration.Toolkit.K11/Models/ContentJob.cs +++ b/Migration.Toolkit.K11/Models/ContentJob.cs @@ -1,30 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentKbarticle.cs b/Migration.Toolkit.K11/Models/ContentKbarticle.cs index 522a79d4..5e6006b9 100644 --- a/Migration.Toolkit.K11/Models/ContentKbarticle.cs +++ b/Migration.Toolkit.K11/Models/ContentKbarticle.cs @@ -1,29 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentLaptop.cs b/Migration.Toolkit.K11/Models/ContentLaptop.cs index 76aa4b5a..f1923854 100644 --- a/Migration.Toolkit.K11/Models/ContentLaptop.cs +++ b/Migration.Toolkit.K11/Models/ContentLaptop.cs @@ -1,55 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentMenuItem.cs b/Migration.Toolkit.K11/Models/ContentMenuItem.cs index f51f33e4..0adba11e 100644 --- a/Migration.Toolkit.K11/Models/ContentMenuItem.cs +++ b/Migration.Toolkit.K11/Models/ContentMenuItem.cs @@ -1,23 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentNews.cs b/Migration.Toolkit.K11/Models/ContentNews.cs index 3f2b6bff..6273efb4 100644 --- a/Migration.Toolkit.K11/Models/ContentNews.cs +++ b/Migration.Toolkit.K11/Models/ContentNews.cs @@ -1,26 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentOffice.cs b/Migration.Toolkit.K11/Models/ContentOffice.cs index 678f3b2e..08043482 100644 --- a/Migration.Toolkit.K11/Models/ContentOffice.cs +++ b/Migration.Toolkit.K11/Models/ContentOffice.cs @@ -1,62 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentPressRelease.cs b/Migration.Toolkit.K11/Models/ContentPressRelease.cs index 4463f5b2..99b23508 100644 --- a/Migration.Toolkit.K11/Models/ContentPressRelease.cs +++ b/Migration.Toolkit.K11/Models/ContentPressRelease.cs @@ -1,28 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentProduct.cs b/Migration.Toolkit.K11/Models/ContentProduct.cs index 690acca2..3911bc84 100644 --- a/Migration.Toolkit.K11/Models/ContentProduct.cs +++ b/Migration.Toolkit.K11/Models/ContentProduct.cs @@ -1,18 +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("CONTENT_Product")] -public partial class ContentProduct -{ - [Key] - [Column("ProductID")] - public int ProductId { get; set; } - - [StringLength(440)] - public string? ProductName { get; set; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentSimpleArticle.cs b/Migration.Toolkit.K11/Models/ContentSimpleArticle.cs index 7e9250d5..cf3f470b 100644 --- a/Migration.Toolkit.K11/Models/ContentSimpleArticle.cs +++ b/Migration.Toolkit.K11/Models/ContentSimpleArticle.cs @@ -1,20 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentSmartphone.cs b/Migration.Toolkit.K11/Models/ContentSmartphone.cs index 83fe2b14..520142e4 100644 --- a/Migration.Toolkit.K11/Models/ContentSmartphone.cs +++ b/Migration.Toolkit.K11/Models/ContentSmartphone.cs @@ -1,57 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ContentSoftware.cs b/Migration.Toolkit.K11/Models/ContentSoftware.cs index 6f9969c1..3b1681de 100644 --- a/Migration.Toolkit.K11/Models/ContentSoftware.cs +++ b/Migration.Toolkit.K11/Models/ContentSoftware.cs @@ -1,27 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/CustomtableSampleTable.cs b/Migration.Toolkit.K11/Models/CustomtableSampleTable.cs index 64c1c7da..95f961a7 100644 --- a/Migration.Toolkit.K11/Models/CustomtableSampleTable.cs +++ b/Migration.Toolkit.K11/Models/CustomtableSampleTable.cs @@ -1,31 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatArticle.cs b/Migration.Toolkit.K11/Models/DancingGoatArticle.cs index 9695b2ee..01147b68 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatArticle.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatArticle.cs @@ -1,25 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatBrewer.cs b/Migration.Toolkit.K11/Models/DancingGoatBrewer.cs index 8666c89a..fbde87f4 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatBrewer.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatBrewer.cs @@ -1,24 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatCafe.cs b/Migration.Toolkit.K11/Models/DancingGoatCafe.cs index 98649d5e..d7ec3c34 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatCafe.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatCafe.cs @@ -1,43 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatCity.cs b/Migration.Toolkit.K11/Models/DancingGoatCity.cs index bbf1ccc9..25b07b25 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatCity.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatCity.cs @@ -1,21 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatCoffee.cs b/Migration.Toolkit.K11/Models/DancingGoatCoffee.cs index ea19f9bc..9da4d300 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatCoffee.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatCoffee.cs @@ -1,38 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatEbook.cs b/Migration.Toolkit.K11/Models/DancingGoatEbook.cs index d3eb8725..4222c449 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatEbook.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatEbook.cs @@ -1,22 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatElectricGrinder.cs b/Migration.Toolkit.K11/Models/DancingGoatElectricGrinder.cs index 6bdd1951..7bafc5de 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatElectricGrinder.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatElectricGrinder.cs @@ -1,26 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatFilterPack.cs b/Migration.Toolkit.K11/Models/DancingGoatFilterPack.cs index f0fd3ba9..effee0b7 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatFilterPack.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatFilterPack.cs @@ -1,26 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatGrinder.cs b/Migration.Toolkit.K11/Models/DancingGoatGrinder.cs index 7a434db2..f75a7302 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatGrinder.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatGrinder.cs @@ -1,24 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatMembership.cs b/Migration.Toolkit.K11/Models/DancingGoatMembership.cs index b2dd333a..806bea6e 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatMembership.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatMembership.cs @@ -1,24 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatOffice.cs b/Migration.Toolkit.K11/Models/DancingGoatOffice.cs index 40786059..495957aa 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatOffice.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatOffice.cs @@ -1,39 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatPartnerCafe.cs b/Migration.Toolkit.K11/Models/DancingGoatPartnerCafe.cs index 67211130..f80fccee 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatPartnerCafe.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatPartnerCafe.cs @@ -1,27 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/DancingGoatTableware.cs b/Migration.Toolkit.K11/Models/DancingGoatTableware.cs index 8b187c9a..92881aa6 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatTableware.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatTableware.cs @@ -1,24 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/EcommerceCheckoutStep.cs b/Migration.Toolkit.K11/Models/EcommerceCheckoutStep.cs index 6c0575fb..4c5a0f45 100644 --- a/Migration.Toolkit.K11/Models/EcommerceCheckoutStep.cs +++ b/Migration.Toolkit.K11/Models/EcommerceCheckoutStep.cs @@ -1,18 +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("Ecommerce_CheckoutStep")] -public partial class EcommerceCheckoutStep -{ - [Key] - [Column("CheckoutStepID")] - public int CheckoutStepId { get; set; } - - [StringLength(1000)] - public string StepName { get; set; } = null!; -} +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 diff --git a/Migration.Toolkit.K11/Models/EcommerceCheckoutWizard.cs b/Migration.Toolkit.K11/Models/EcommerceCheckoutWizard.cs index c9ac9fff..85423648 100644 --- a/Migration.Toolkit.K11/Models/EcommerceCheckoutWizard.cs +++ b/Migration.Toolkit.K11/Models/EcommerceCheckoutWizard.cs @@ -1,18 +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("Ecommerce_CheckoutWizard")] -public partial class EcommerceCheckoutWizard -{ - [Key] - [Column("CheckoutWizardID")] - public int CheckoutWizardId { get; set; } - - [StringLength(1000)] - public string? WizardName { get; set; } -} +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 diff --git a/Migration.Toolkit.K11/Models/EventsAttendee.cs b/Migration.Toolkit.K11/Models/EventsAttendee.cs index d523bee4..e8253c6c 100644 --- a/Migration.Toolkit.K11/Models/EventsAttendee.cs +++ b/Migration.Toolkit.K11/Models/EventsAttendee.cs @@ -1,40 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ExportHistory.cs b/Migration.Toolkit.K11/Models/ExportHistory.cs index c2248bf9..cd69b3a2 100644 --- a/Migration.Toolkit.K11/Models/ExportHistory.cs +++ b/Migration.Toolkit.K11/Models/ExportHistory.cs @@ -1,38 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ExportTask.cs b/Migration.Toolkit.K11/Models/ExportTask.cs index ba619755..a2081d54 100644 --- a/Migration.Toolkit.K11/Models/ExportTask.cs +++ b/Migration.Toolkit.K11/Models/ExportTask.cs @@ -1,39 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/FormContactU.cs b/Migration.Toolkit.K11/Models/FormContactU.cs index 7b443173..f65d74ca 100644 --- a/Migration.Toolkit.K11/Models/FormContactU.cs +++ b/Migration.Toolkit.K11/Models/FormContactU.cs @@ -1,33 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs b/Migration.Toolkit.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs index b9fa7cb4..37d83650 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs +++ b/Migration.Toolkit.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs @@ -1,39 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatContactU.cs b/Migration.Toolkit.K11/Models/FormDancingGoatContactU.cs index e7e7bb95..eac2900c 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatContactU.cs +++ b/Migration.Toolkit.K11/Models/FormDancingGoatContactU.cs @@ -1,33 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatMachineRental.cs b/Migration.Toolkit.K11/Models/FormDancingGoatMachineRental.cs index 344ca7bb..368ae9b5 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatMachineRental.cs +++ b/Migration.Toolkit.K11/Models/FormDancingGoatMachineRental.cs @@ -1,33 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatTryFreeSample.cs b/Migration.Toolkit.K11/Models/FormDancingGoatTryFreeSample.cs index e7dd275a..5c9ec61c 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatTryFreeSample.cs +++ b/Migration.Toolkit.K11/Models/FormDancingGoatTryFreeSample.cs @@ -1,46 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/FormEcommerceSiteGeneralQuestion.cs b/Migration.Toolkit.K11/Models/FormEcommerceSiteGeneralQuestion.cs index 67e09a5c..504f6414 100644 --- a/Migration.Toolkit.K11/Models/FormEcommerceSiteGeneralQuestion.cs +++ b/Migration.Toolkit.K11/Models/FormEcommerceSiteGeneralQuestion.cs @@ -1,24 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/FormEcommerceSiteProductQuestion.cs b/Migration.Toolkit.K11/Models/FormEcommerceSiteProductQuestion.cs index b774dded..7ea136e9 100644 --- a/Migration.Toolkit.K11/Models/FormEcommerceSiteProductQuestion.cs +++ b/Migration.Toolkit.K11/Models/FormEcommerceSiteProductQuestion.cs @@ -1,27 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ForumsAttachment.cs b/Migration.Toolkit.K11/Models/ForumsAttachment.cs index a052dde7..35f4207f 100644 --- a/Migration.Toolkit.K11/Models/ForumsAttachment.cs +++ b/Migration.Toolkit.K11/Models/ForumsAttachment.cs @@ -1,53 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ForumsForum.cs b/Migration.Toolkit.K11/Models/ForumsForum.cs index eafb591e..b7fe9a46 100644 --- a/Migration.Toolkit.K11/Models/ForumsForum.cs +++ b/Migration.Toolkit.K11/Models/ForumsForum.cs @@ -1,147 +1,147 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ForumsForumGroup.cs b/Migration.Toolkit.K11/Models/ForumsForumGroup.cs index c6b1a1c8..97a05c59 100644 --- a/Migration.Toolkit.K11/Models/ForumsForumGroup.cs +++ b/Migration.Toolkit.K11/Models/ForumsForumGroup.cs @@ -1,89 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ForumsForumPost.cs b/Migration.Toolkit.K11/Models/ForumsForumPost.cs index 55d429ec..de206ebd 100644 --- a/Migration.Toolkit.K11/Models/ForumsForumPost.cs +++ b/Migration.Toolkit.K11/Models/ForumsForumPost.cs @@ -1,124 +1,124 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ForumsForumRole.cs b/Migration.Toolkit.K11/Models/ForumsForumRole.cs index fd2890e4..5f45e663 100644 --- a/Migration.Toolkit.K11/Models/ForumsForumRole.cs +++ b/Migration.Toolkit.K11/Models/ForumsForumRole.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ForumsForumSubscription.cs b/Migration.Toolkit.K11/Models/ForumsForumSubscription.cs index dfc65a19..1f100102 100644 --- a/Migration.Toolkit.K11/Models/ForumsForumSubscription.cs +++ b/Migration.Toolkit.K11/Models/ForumsForumSubscription.cs @@ -1,52 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ForumsUserFavorite.cs b/Migration.Toolkit.K11/Models/ForumsUserFavorite.cs index 2915aedf..c3217c6a 100644 --- a/Migration.Toolkit.K11/Models/ForumsUserFavorite.cs +++ b/Migration.Toolkit.K11/Models/ForumsUserFavorite.cs @@ -1,56 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/IntegrationConnector.cs b/Migration.Toolkit.K11/Models/IntegrationConnector.cs index b587e9df..477f3fad 100644 --- a/Migration.Toolkit.K11/Models/IntegrationConnector.cs +++ b/Migration.Toolkit.K11/Models/IntegrationConnector.cs @@ -1,36 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/IntegrationSyncLog.cs b/Migration.Toolkit.K11/Models/IntegrationSyncLog.cs index 8b84fb48..1e138961 100644 --- a/Migration.Toolkit.K11/Models/IntegrationSyncLog.cs +++ b/Migration.Toolkit.K11/Models/IntegrationSyncLog.cs @@ -1,27 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/IntegrationSynchronization.cs b/Migration.Toolkit.K11/Models/IntegrationSynchronization.cs index 7d91eb5a..4d351ffa 100644 --- a/Migration.Toolkit.K11/Models/IntegrationSynchronization.cs +++ b/Migration.Toolkit.K11/Models/IntegrationSynchronization.cs @@ -1,40 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/IntegrationTask.cs b/Migration.Toolkit.K11/Models/IntegrationTask.cs index 25c12395..85e71c0c 100644 --- a/Migration.Toolkit.K11/Models/IntegrationTask.cs +++ b/Migration.Toolkit.K11/Models/IntegrationTask.cs @@ -1,60 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/IntranetPortalDepartment.cs b/Migration.Toolkit.K11/Models/IntranetPortalDepartment.cs index 5abce3a9..85be1926 100644 --- a/Migration.Toolkit.K11/Models/IntranetPortalDepartment.cs +++ b/Migration.Toolkit.K11/Models/IntranetPortalDepartment.cs @@ -1,29 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/IntranetPortalWorkingEnvironment.cs b/Migration.Toolkit.K11/Models/IntranetPortalWorkingEnvironment.cs index 887ac15c..7e2b89a9 100644 --- a/Migration.Toolkit.K11/Models/IntranetPortalWorkingEnvironment.cs +++ b/Migration.Toolkit.K11/Models/IntranetPortalWorkingEnvironment.cs @@ -1,27 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/MediaFile.cs b/Migration.Toolkit.K11/Models/MediaFile.cs index 5d6652ba..7b7b0da1 100644 --- a/Migration.Toolkit.K11/Models/MediaFile.cs +++ b/Migration.Toolkit.K11/Models/MediaFile.cs @@ -1,78 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/MediaLibrary.cs b/Migration.Toolkit.K11/Models/MediaLibrary.cs index c86a38c0..1c9dbe5e 100644 --- a/Migration.Toolkit.K11/Models/MediaLibrary.cs +++ b/Migration.Toolkit.K11/Models/MediaLibrary.cs @@ -1,61 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/MediaLibraryRolePermission.cs b/Migration.Toolkit.K11/Models/MediaLibraryRolePermission.cs index 7753c6bc..276a6336 100644 --- a/Migration.Toolkit.K11/Models/MediaLibraryRolePermission.cs +++ b/Migration.Toolkit.K11/Models/MediaLibraryRolePermission.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/MessagingMessage.cs b/Migration.Toolkit.K11/Models/MessagingMessage.cs index b88c7222..673f39eb 100644 --- a/Migration.Toolkit.K11/Models/MessagingMessage.cs +++ b/Migration.Toolkit.K11/Models/MessagingMessage.cs @@ -1,56 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterAbtest.cs b/Migration.Toolkit.K11/Models/NewsletterAbtest.cs index ff0ab3ad..998b905e 100644 --- a/Migration.Toolkit.K11/Models/NewsletterAbtest.cs +++ b/Migration.Toolkit.K11/Models/NewsletterAbtest.cs @@ -1,54 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterClickedLink.cs b/Migration.Toolkit.K11/Models/NewsletterClickedLink.cs index 564eea55..dd94eaa3 100644 --- a/Migration.Toolkit.K11/Models/NewsletterClickedLink.cs +++ b/Migration.Toolkit.K11/Models/NewsletterClickedLink.cs @@ -1,30 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterEmail.cs b/Migration.Toolkit.K11/Models/NewsletterEmail.cs index 201b595a..a8bc989a 100644 --- a/Migration.Toolkit.K11/Models/NewsletterEmail.cs +++ b/Migration.Toolkit.K11/Models/NewsletterEmail.cs @@ -1,56 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterEmailTemplate.cs b/Migration.Toolkit.K11/Models/NewsletterEmailTemplate.cs index 8b2349a3..611be700 100644 --- a/Migration.Toolkit.K11/Models/NewsletterEmailTemplate.cs +++ b/Migration.Toolkit.K11/Models/NewsletterEmailTemplate.cs @@ -1,69 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterEmailWidget.cs b/Migration.Toolkit.K11/Models/NewsletterEmailWidget.cs index deee907e..c319adcf 100644 --- a/Migration.Toolkit.K11/Models/NewsletterEmailWidget.cs +++ b/Migration.Toolkit.K11/Models/NewsletterEmailWidget.cs @@ -1,48 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Toolkit.K11/Models/NewsletterEmailWidgetTemplate.cs index 5485c76b..b35f054d 100644 --- a/Migration.Toolkit.K11/Models/NewsletterEmailWidgetTemplate.cs +++ b/Migration.Toolkit.K11/Models/NewsletterEmailWidgetTemplate.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterIssueContactGroup.cs b/Migration.Toolkit.K11/Models/NewsletterIssueContactGroup.cs index 926941e9..51e50c27 100644 --- a/Migration.Toolkit.K11/Models/NewsletterIssueContactGroup.cs +++ b/Migration.Toolkit.K11/Models/NewsletterIssueContactGroup.cs @@ -1,26 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterLink.cs b/Migration.Toolkit.K11/Models/NewsletterLink.cs index 7347ae87..a7fa2dca 100644 --- a/Migration.Toolkit.K11/Models/NewsletterLink.cs +++ b/Migration.Toolkit.K11/Models/NewsletterLink.cs @@ -1,34 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterNewsletter.cs b/Migration.Toolkit.K11/Models/NewsletterNewsletter.cs index 23b689ac..0e41c18e 100644 --- a/Migration.Toolkit.K11/Models/NewsletterNewsletter.cs +++ b/Migration.Toolkit.K11/Models/NewsletterNewsletter.cs @@ -1,116 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterNewsletterIssue.cs b/Migration.Toolkit.K11/Models/NewsletterNewsletterIssue.cs index d2b7258c..c017d251 100644 --- a/Migration.Toolkit.K11/Models/NewsletterNewsletterIssue.cs +++ b/Migration.Toolkit.K11/Models/NewsletterNewsletterIssue.cs @@ -1,126 +1,126 @@ -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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterOpenedEmail.cs b/Migration.Toolkit.K11/Models/NewsletterOpenedEmail.cs index 121b8e38..a4b85d7f 100644 --- a/Migration.Toolkit.K11/Models/NewsletterOpenedEmail.cs +++ b/Migration.Toolkit.K11/Models/NewsletterOpenedEmail.cs @@ -1,30 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterSubscriber.cs b/Migration.Toolkit.K11/Models/NewsletterSubscriber.cs index 2a7aa84f..854198bd 100644 --- a/Migration.Toolkit.K11/Models/NewsletterSubscriber.cs +++ b/Migration.Toolkit.K11/Models/NewsletterSubscriber.cs @@ -1,57 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterSubscriberNewsletter.cs b/Migration.Toolkit.K11/Models/NewsletterSubscriberNewsletter.cs index edd3aa78..d90907f2 100644 --- a/Migration.Toolkit.K11/Models/NewsletterSubscriberNewsletter.cs +++ b/Migration.Toolkit.K11/Models/NewsletterSubscriberNewsletter.cs @@ -1,40 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/NewsletterUnsubscription.cs b/Migration.Toolkit.K11/Models/NewsletterUnsubscription.cs index 1fc92b2f..ece5108f 100644 --- a/Migration.Toolkit.K11/Models/NewsletterUnsubscription.cs +++ b/Migration.Toolkit.K11/Models/NewsletterUnsubscription.cs @@ -1,40 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/NotificationGateway.cs b/Migration.Toolkit.K11/Models/NotificationGateway.cs index 6624f5cd..5201240c 100644 --- a/Migration.Toolkit.K11/Models/NotificationGateway.cs +++ b/Migration.Toolkit.K11/Models/NotificationGateway.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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/NotificationSubscription.cs b/Migration.Toolkit.K11/Models/NotificationSubscription.cs index 4b1b4bf7..ff6a174e 100644 --- a/Migration.Toolkit.K11/Models/NotificationSubscription.cs +++ b/Migration.Toolkit.K11/Models/NotificationSubscription.cs @@ -1,77 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/NotificationTemplate.cs b/Migration.Toolkit.K11/Models/NotificationTemplate.cs index 1840fe3e..eedbdaf8 100644 --- a/Migration.Toolkit.K11/Models/NotificationTemplate.cs +++ b/Migration.Toolkit.K11/Models/NotificationTemplate.cs @@ -1,40 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/NotificationTemplateText.cs b/Migration.Toolkit.K11/Models/NotificationTemplateText.cs index 1bd2e6c7..c629384a 100644 --- a/Migration.Toolkit.K11/Models/NotificationTemplateText.cs +++ b/Migration.Toolkit.K11/Models/NotificationTemplateText.cs @@ -1,44 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/OmAbtest.cs b/Migration.Toolkit.K11/Models/OmAbtest.cs index 8cbece62..64676145 100644 --- a/Migration.Toolkit.K11/Models/OmAbtest.cs +++ b/Migration.Toolkit.K11/Models/OmAbtest.cs @@ -1,69 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/OmAbvariant.cs b/Migration.Toolkit.K11/Models/OmAbvariant.cs index dec3fd1e..a450dada 100644 --- a/Migration.Toolkit.K11/Models/OmAbvariant.cs +++ b/Migration.Toolkit.K11/Models/OmAbvariant.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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/OmAccount.cs b/Migration.Toolkit.K11/Models/OmAccount.cs index 5afdc04b..8f341ce1 100644 --- a/Migration.Toolkit.K11/Models/OmAccount.cs +++ b/Migration.Toolkit.K11/Models/OmAccount.cs @@ -1,114 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/OmAccountContact.cs b/Migration.Toolkit.K11/Models/OmAccountContact.cs index c7fa133d..418e7425 100644 --- a/Migration.Toolkit.K11/Models/OmAccountContact.cs +++ b/Migration.Toolkit.K11/Models/OmAccountContact.cs @@ -1,39 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/OmAccountStatus.cs b/Migration.Toolkit.K11/Models/OmAccountStatus.cs index f2797792..cb669366 100644 --- a/Migration.Toolkit.K11/Models/OmAccountStatus.cs +++ b/Migration.Toolkit.K11/Models/OmAccountStatus.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/OmActivity.cs b/Migration.Toolkit.K11/Models/OmActivity.cs index 4567ca18..f284d33a 100644 --- a/Migration.Toolkit.K11/Models/OmActivity.cs +++ b/Migration.Toolkit.K11/Models/OmActivity.cs @@ -1,79 +1,79 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.K11/Models/OmActivityRecalculationQueue.cs index bb5442ba..1054df9f 100644 --- a/Migration.Toolkit.K11/Models/OmActivityRecalculationQueue.cs +++ b/Migration.Toolkit.K11/Models/OmActivityRecalculationQueue.cs @@ -1,18 +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("OM_ActivityRecalculationQueue")] -public partial class OmActivityRecalculationQueue -{ - [Key] - [Column("ActivityRecalculationQueueID")] - public int ActivityRecalculationQueueId { get; set; } - - [Column("ActivityRecalculationQueueActivityID")] - public int ActivityRecalculationQueueActivityId { get; set; } -} +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 diff --git a/Migration.Toolkit.K11/Models/OmActivityType.cs b/Migration.Toolkit.K11/Models/OmActivityType.cs index 5b8b63c5..eaf00b67 100644 --- a/Migration.Toolkit.K11/Models/OmActivityType.cs +++ b/Migration.Toolkit.K11/Models/OmActivityType.cs @@ -1,40 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/OmContact.cs b/Migration.Toolkit.K11/Models/OmContact.cs index 9ce6f5a6..0811195b 100644 --- a/Migration.Toolkit.K11/Models/OmContact.cs +++ b/Migration.Toolkit.K11/Models/OmContact.cs @@ -1,141 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.K11/Models/OmContactChangeRecalculationQueue.cs index 4dddcfb5..52eb6bb0 100644 --- a/Migration.Toolkit.K11/Models/OmContactChangeRecalculationQueue.cs +++ b/Migration.Toolkit.K11/Models/OmContactChangeRecalculationQueue.cs @@ -1,24 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/OmContactGroup.cs b/Migration.Toolkit.K11/Models/OmContactGroup.cs index bbbe41fb..98b0c4f0 100644 --- a/Migration.Toolkit.K11/Models/OmContactGroup.cs +++ b/Migration.Toolkit.K11/Models/OmContactGroup.cs @@ -1,40 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/OmContactGroupMember.cs b/Migration.Toolkit.K11/Models/OmContactGroupMember.cs index 6f7b0e53..44392576 100644 --- a/Migration.Toolkit.K11/Models/OmContactGroupMember.cs +++ b/Migration.Toolkit.K11/Models/OmContactGroupMember.cs @@ -1,36 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/OmContactRole.cs b/Migration.Toolkit.K11/Models/OmContactRole.cs index 630c55e0..806da7fa 100644 --- a/Migration.Toolkit.K11/Models/OmContactRole.cs +++ b/Migration.Toolkit.K11/Models/OmContactRole.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/OmContactStatus.cs b/Migration.Toolkit.K11/Models/OmContactStatus.cs index 39b07e79..260a07c8 100644 --- a/Migration.Toolkit.K11/Models/OmContactStatus.cs +++ b/Migration.Toolkit.K11/Models/OmContactStatus.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/OmMembership.cs b/Migration.Toolkit.K11/Models/OmMembership.cs index 8ff4c41b..f5ff06ff 100644 --- a/Migration.Toolkit.K11/Models/OmMembership.cs +++ b/Migration.Toolkit.K11/Models/OmMembership.cs @@ -1,34 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/OmMvtcombination.cs b/Migration.Toolkit.K11/Models/OmMvtcombination.cs index f9c29622..21dbe0d4 100644 --- a/Migration.Toolkit.K11/Models/OmMvtcombination.cs +++ b/Migration.Toolkit.K11/Models/OmMvtcombination.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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/OmMvtest.cs b/Migration.Toolkit.K11/Models/OmMvtest.cs index 9966bf22..ba0a284b 100644 --- a/Migration.Toolkit.K11/Models/OmMvtest.cs +++ b/Migration.Toolkit.K11/Models/OmMvtest.cs @@ -1,67 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/OmMvtvariant.cs b/Migration.Toolkit.K11/Models/OmMvtvariant.cs index c36d1047..504a172c 100644 --- a/Migration.Toolkit.K11/Models/OmMvtvariant.cs +++ b/Migration.Toolkit.K11/Models/OmMvtvariant.cs @@ -1,61 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/OmPersonalizationVariant.cs b/Migration.Toolkit.K11/Models/OmPersonalizationVariant.cs index 39b8b090..2ef23dde 100644 --- a/Migration.Toolkit.K11/Models/OmPersonalizationVariant.cs +++ b/Migration.Toolkit.K11/Models/OmPersonalizationVariant.cs @@ -1,60 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/OmRule.cs b/Migration.Toolkit.K11/Models/OmRule.cs index f0ff456d..5a06dab2 100644 --- a/Migration.Toolkit.K11/Models/OmRule.cs +++ b/Migration.Toolkit.K11/Models/OmRule.cs @@ -1,59 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/OmScore.cs b/Migration.Toolkit.K11/Models/OmScore.cs index 70370692..ae6f677b 100644 --- a/Migration.Toolkit.K11/Models/OmScore.cs +++ b/Migration.Toolkit.K11/Models/OmScore.cs @@ -1,48 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/OmScoreContactRule.cs b/Migration.Toolkit.K11/Models/OmScoreContactRule.cs index fe645c1f..6f929c9b 100644 --- a/Migration.Toolkit.K11/Models/OmScoreContactRule.cs +++ b/Migration.Toolkit.K11/Models/OmScoreContactRule.cs @@ -1,44 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/OmVisitorToContact.cs b/Migration.Toolkit.K11/Models/OmVisitorToContact.cs index d50bbc66..1ef7adfe 100644 --- a/Migration.Toolkit.K11/Models/OmVisitorToContact.cs +++ b/Migration.Toolkit.K11/Models/OmVisitorToContact.cs @@ -1,27 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/PersonasPersona.cs b/Migration.Toolkit.K11/Models/PersonasPersona.cs index f22ad172..b39f670e 100644 --- a/Migration.Toolkit.K11/Models/PersonasPersona.cs +++ b/Migration.Toolkit.K11/Models/PersonasPersona.cs @@ -1,41 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/PersonasPersonaContactHistory.cs b/Migration.Toolkit.K11/Models/PersonasPersonaContactHistory.cs index 0593f7e9..bf542336 100644 --- a/Migration.Toolkit.K11/Models/PersonasPersonaContactHistory.cs +++ b/Migration.Toolkit.K11/Models/PersonasPersonaContactHistory.cs @@ -1,28 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/PersonasPersonaNode.cs b/Migration.Toolkit.K11/Models/PersonasPersonaNode.cs index b5d039b7..bf20c8f9 100644 --- a/Migration.Toolkit.K11/Models/PersonasPersonaNode.cs +++ b/Migration.Toolkit.K11/Models/PersonasPersonaNode.cs @@ -1,26 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/PollsPoll.cs b/Migration.Toolkit.K11/Models/PollsPoll.cs index 9df9a38b..d0a65df8 100644 --- a/Migration.Toolkit.K11/Models/PollsPoll.cs +++ b/Migration.Toolkit.K11/Models/PollsPoll.cs @@ -1,72 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/PollsPollAnswer.cs b/Migration.Toolkit.K11/Models/PollsPollAnswer.cs index 88899872..5b411f83 100644 --- a/Migration.Toolkit.K11/Models/PollsPollAnswer.cs +++ b/Migration.Toolkit.K11/Models/PollsPollAnswer.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.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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ReportingReport.cs b/Migration.Toolkit.K11/Models/ReportingReport.cs index bee39153..5fe8f817 100644 --- a/Migration.Toolkit.K11/Models/ReportingReport.cs +++ b/Migration.Toolkit.K11/Models/ReportingReport.cs @@ -1,62 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ReportingReportCategory.cs b/Migration.Toolkit.K11/Models/ReportingReportCategory.cs index eae5866b..7f2ff26b 100644 --- a/Migration.Toolkit.K11/Models/ReportingReportCategory.cs +++ b/Migration.Toolkit.K11/Models/ReportingReportCategory.cs @@ -1,51 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ReportingReportGraph.cs b/Migration.Toolkit.K11/Models/ReportingReportGraph.cs index b4970f36..fffbcb1e 100644 --- a/Migration.Toolkit.K11/Models/ReportingReportGraph.cs +++ b/Migration.Toolkit.K11/Models/ReportingReportGraph.cs @@ -1,69 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/ReportingReportSubscription.cs b/Migration.Toolkit.K11/Models/ReportingReportSubscription.cs index 90389ad9..2cd75342 100644 --- a/Migration.Toolkit.K11/Models/ReportingReportSubscription.cs +++ b/Migration.Toolkit.K11/Models/ReportingReportSubscription.cs @@ -1,93 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ReportingReportTable.cs b/Migration.Toolkit.K11/Models/ReportingReportTable.cs index 6fadd208..144dbbe3 100644 --- a/Migration.Toolkit.K11/Models/ReportingReportTable.cs +++ b/Migration.Toolkit.K11/Models/ReportingReportTable.cs @@ -1,47 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ReportingReportValue.cs b/Migration.Toolkit.K11/Models/ReportingReportValue.cs index e38e87f9..a9b05d8c 100644 --- a/Migration.Toolkit.K11/Models/ReportingReportValue.cs +++ b/Migration.Toolkit.K11/Models/ReportingReportValue.cs @@ -1,50 +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_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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ReportingSavedGraph.cs b/Migration.Toolkit.K11/Models/ReportingSavedGraph.cs index 57ee766d..c544436e 100644 --- a/Migration.Toolkit.K11/Models/ReportingSavedGraph.cs +++ b/Migration.Toolkit.K11/Models/ReportingSavedGraph.cs @@ -1,34 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ReportingSavedReport.cs b/Migration.Toolkit.K11/Models/ReportingSavedReport.cs index 0bb0eb0b..f8b1528c 100644 --- a/Migration.Toolkit.K11/Models/ReportingSavedReport.cs +++ b/Migration.Toolkit.K11/Models/ReportingSavedReport.cs @@ -1,48 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/SharePointSharePointConnection.cs b/Migration.Toolkit.K11/Models/SharePointSharePointConnection.cs index 48da68c4..d1594e9b 100644 --- a/Migration.Toolkit.K11/Models/SharePointSharePointConnection.cs +++ b/Migration.Toolkit.K11/Models/SharePointSharePointConnection.cs @@ -1,55 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/SharePointSharePointFile.cs b/Migration.Toolkit.K11/Models/SharePointSharePointFile.cs index d6f176ff..0f721155 100644 --- a/Migration.Toolkit.K11/Models/SharePointSharePointFile.cs +++ b/Migration.Toolkit.K11/Models/SharePointSharePointFile.cs @@ -1,57 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/SharePointSharePointLibrary.cs b/Migration.Toolkit.K11/Models/SharePointSharePointLibrary.cs index 9fe40ad9..4b8ebe2c 100644 --- a/Migration.Toolkit.K11/Models/SharePointSharePointLibrary.cs +++ b/Migration.Toolkit.K11/Models/SharePointSharePointLibrary.cs @@ -1,52 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/SmFacebookAccount.cs b/Migration.Toolkit.K11/Models/SmFacebookAccount.cs index 5549cae3..b88bbe33 100644 --- a/Migration.Toolkit.K11/Models/SmFacebookAccount.cs +++ b/Migration.Toolkit.K11/Models/SmFacebookAccount.cs @@ -1,58 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/SmFacebookApplication.cs b/Migration.Toolkit.K11/Models/SmFacebookApplication.cs index ef7794b3..23e60af4 100644 --- a/Migration.Toolkit.K11/Models/SmFacebookApplication.cs +++ b/Migration.Toolkit.K11/Models/SmFacebookApplication.cs @@ -1,43 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/SmFacebookPost.cs b/Migration.Toolkit.K11/Models/SmFacebookPost.cs index d0516fa0..46d11ba4 100644 --- a/Migration.Toolkit.K11/Models/SmFacebookPost.cs +++ b/Migration.Toolkit.K11/Models/SmFacebookPost.cs @@ -1,89 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/SmInsight.cs b/Migration.Toolkit.K11/Models/SmInsight.cs index d2e5493a..42f48dd3 100644 --- a/Migration.Toolkit.K11/Models/SmInsight.cs +++ b/Migration.Toolkit.K11/Models/SmInsight.cs @@ -1,39 +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_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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/SmInsightHitDay.cs b/Migration.Toolkit.K11/Models/SmInsightHitDay.cs index c148619d..c7100481 100644 --- a/Migration.Toolkit.K11/Models/SmInsightHitDay.cs +++ b/Migration.Toolkit.K11/Models/SmInsightHitDay.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/SmInsightHitMonth.cs b/Migration.Toolkit.K11/Models/SmInsightHitMonth.cs index e9ed316a..abec5cc6 100644 --- a/Migration.Toolkit.K11/Models/SmInsightHitMonth.cs +++ b/Migration.Toolkit.K11/Models/SmInsightHitMonth.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/SmInsightHitWeek.cs b/Migration.Toolkit.K11/Models/SmInsightHitWeek.cs index e7e59e2a..2c1b665b 100644 --- a/Migration.Toolkit.K11/Models/SmInsightHitWeek.cs +++ b/Migration.Toolkit.K11/Models/SmInsightHitWeek.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/SmInsightHitYear.cs b/Migration.Toolkit.K11/Models/SmInsightHitYear.cs index 752971e2..2a03934c 100644 --- a/Migration.Toolkit.K11/Models/SmInsightHitYear.cs +++ b/Migration.Toolkit.K11/Models/SmInsightHitYear.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/SmLinkedInAccount.cs b/Migration.Toolkit.K11/Models/SmLinkedInAccount.cs index 73d9926d..883077f9 100644 --- a/Migration.Toolkit.K11/Models/SmLinkedInAccount.cs +++ b/Migration.Toolkit.K11/Models/SmLinkedInAccount.cs @@ -1,52 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/SmLinkedInApplication.cs b/Migration.Toolkit.K11/Models/SmLinkedInApplication.cs index 27da8392..ada243f5 100644 --- a/Migration.Toolkit.K11/Models/SmLinkedInApplication.cs +++ b/Migration.Toolkit.K11/Models/SmLinkedInApplication.cs @@ -1,40 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/SmLinkedInPost.cs b/Migration.Toolkit.K11/Models/SmLinkedInPost.cs index dc26005c..9ae8fbd5 100644 --- a/Migration.Toolkit.K11/Models/SmLinkedInPost.cs +++ b/Migration.Toolkit.K11/Models/SmLinkedInPost.cs @@ -1,85 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/SmTwitterAccount.cs b/Migration.Toolkit.K11/Models/SmTwitterAccount.cs index 7a5a9e3d..cb995c92 100644 --- a/Migration.Toolkit.K11/Models/SmTwitterAccount.cs +++ b/Migration.Toolkit.K11/Models/SmTwitterAccount.cs @@ -1,64 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/SmTwitterApplication.cs b/Migration.Toolkit.K11/Models/SmTwitterApplication.cs index 7f6a4634..85cad25a 100644 --- a/Migration.Toolkit.K11/Models/SmTwitterApplication.cs +++ b/Migration.Toolkit.K11/Models/SmTwitterApplication.cs @@ -1,43 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/SmTwitterPost.cs b/Migration.Toolkit.K11/Models/SmTwitterPost.cs index 10568fa8..48f6c231 100644 --- a/Migration.Toolkit.K11/Models/SmTwitterPost.cs +++ b/Migration.Toolkit.K11/Models/SmTwitterPost.cs @@ -1,71 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/StagingServer.cs b/Migration.Toolkit.K11/Models/StagingServer.cs index 15205402..eca747c7 100644 --- a/Migration.Toolkit.K11/Models/StagingServer.cs +++ b/Migration.Toolkit.K11/Models/StagingServer.cs @@ -1,62 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/StagingSynchronization.cs b/Migration.Toolkit.K11/Models/StagingSynchronization.cs index 7097c6fd..d0bbc2a5 100644 --- a/Migration.Toolkit.K11/Models/StagingSynchronization.cs +++ b/Migration.Toolkit.K11/Models/StagingSynchronization.cs @@ -1,35 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/StagingTask.cs b/Migration.Toolkit.K11/Models/StagingTask.cs index c6997b1b..0fd60d9d 100644 --- a/Migration.Toolkit.K11/Models/StagingTask.cs +++ b/Migration.Toolkit.K11/Models/StagingTask.cs @@ -1,64 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StagingTaskGroup.cs b/Migration.Toolkit.K11/Models/StagingTaskGroup.cs index 3d282a47..21c7c6ff 100644 --- a/Migration.Toolkit.K11/Models/StagingTaskGroup.cs +++ b/Migration.Toolkit.K11/Models/StagingTaskGroup.cs @@ -1,28 +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("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(); -} +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 diff --git a/Migration.Toolkit.K11/Models/StagingTaskGroupTask.cs b/Migration.Toolkit.K11/Models/StagingTaskGroupTask.cs index f9acb6da..a627256c 100644 --- a/Migration.Toolkit.K11/Models/StagingTaskGroupTask.cs +++ b/Migration.Toolkit.K11/Models/StagingTaskGroupTask.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/StagingTaskGroupUser.cs b/Migration.Toolkit.K11/Models/StagingTaskGroupUser.cs index 270ae177..50bab5eb 100644 --- a/Migration.Toolkit.K11/Models/StagingTaskGroupUser.cs +++ b/Migration.Toolkit.K11/Models/StagingTaskGroupUser.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/StagingTaskUser.cs b/Migration.Toolkit.K11/Models/StagingTaskUser.cs index c9bfd8a3..e6819d6d 100644 --- a/Migration.Toolkit.K11/Models/StagingTaskUser.cs +++ b/Migration.Toolkit.K11/Models/StagingTaskUser.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentBook.cs b/Migration.Toolkit.K11/Models/StorecontentBook.cs index 1116e317..9e49464b 100644 --- a/Migration.Toolkit.K11/Models/StorecontentBook.cs +++ b/Migration.Toolkit.K11/Models/StorecontentBook.cs @@ -1,26 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentCellPhone.cs b/Migration.Toolkit.K11/Models/StorecontentCellPhone.cs index dd387576..0191d3cb 100644 --- a/Migration.Toolkit.K11/Models/StorecontentCellPhone.cs +++ b/Migration.Toolkit.K11/Models/StorecontentCellPhone.cs @@ -1,72 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentComputer.cs b/Migration.Toolkit.K11/Models/StorecontentComputer.cs index 025d71f7..65bb4e4b 100644 --- a/Migration.Toolkit.K11/Models/StorecontentComputer.cs +++ b/Migration.Toolkit.K11/Models/StorecontentComputer.cs @@ -1,41 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentCup.cs b/Migration.Toolkit.K11/Models/StorecontentCup.cs index 3d40c090..89d413d9 100644 --- a/Migration.Toolkit.K11/Models/StorecontentCup.cs +++ b/Migration.Toolkit.K11/Models/StorecontentCup.cs @@ -1,24 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentLaptop.cs b/Migration.Toolkit.K11/Models/StorecontentLaptop.cs index 67f05f12..176aaa27 100644 --- a/Migration.Toolkit.K11/Models/StorecontentLaptop.cs +++ b/Migration.Toolkit.K11/Models/StorecontentLaptop.cs @@ -1,64 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentMediaPlayer.cs b/Migration.Toolkit.K11/Models/StorecontentMediaPlayer.cs index 818cea6c..95229daf 100644 --- a/Migration.Toolkit.K11/Models/StorecontentMediaPlayer.cs +++ b/Migration.Toolkit.K11/Models/StorecontentMediaPlayer.cs @@ -1,37 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentPant.cs b/Migration.Toolkit.K11/Models/StorecontentPant.cs index 5e14b473..9cd760c0 100644 --- a/Migration.Toolkit.K11/Models/StorecontentPant.cs +++ b/Migration.Toolkit.K11/Models/StorecontentPant.cs @@ -1,21 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentPerfume.cs b/Migration.Toolkit.K11/Models/StorecontentPerfume.cs index cd35095e..80d875c4 100644 --- a/Migration.Toolkit.K11/Models/StorecontentPerfume.cs +++ b/Migration.Toolkit.K11/Models/StorecontentPerfume.cs @@ -1,21 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentShoe.cs b/Migration.Toolkit.K11/Models/StorecontentShoe.cs index ae6db223..4bf4c219 100644 --- a/Migration.Toolkit.K11/Models/StorecontentShoe.cs +++ b/Migration.Toolkit.K11/Models/StorecontentShoe.cs @@ -1,21 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentTablet.cs b/Migration.Toolkit.K11/Models/StorecontentTablet.cs index 8af4fc6a..1c99fa60 100644 --- a/Migration.Toolkit.K11/Models/StorecontentTablet.cs +++ b/Migration.Toolkit.K11/Models/StorecontentTablet.cs @@ -1,55 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentTshirt.cs b/Migration.Toolkit.K11/Models/StorecontentTshirt.cs index 0e8785a7..3c9f54a1 100644 --- a/Migration.Toolkit.K11/Models/StorecontentTshirt.cs +++ b/Migration.Toolkit.K11/Models/StorecontentTshirt.cs @@ -1,21 +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_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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentTv.cs b/Migration.Toolkit.K11/Models/StorecontentTv.cs index 78cf1af9..5f298fa5 100644 --- a/Migration.Toolkit.K11/Models/StorecontentTv.cs +++ b/Migration.Toolkit.K11/Models/StorecontentTv.cs @@ -1,50 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/StorecontentWatch.cs b/Migration.Toolkit.K11/Models/StorecontentWatch.cs index 2bcf0392..f3b6fd05 100644 --- a/Migration.Toolkit.K11/Models/StorecontentWatch.cs +++ b/Migration.Toolkit.K11/Models/StorecontentWatch.cs @@ -1,30 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/TempFile.cs b/Migration.Toolkit.K11/Models/TempFile.cs index 1cf34db5..ac93841c 100644 --- a/Migration.Toolkit.K11/Models/TempFile.cs +++ b/Migration.Toolkit.K11/Models/TempFile.cs @@ -1,50 +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("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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewBoardsBoardMessageJoined.cs b/Migration.Toolkit.K11/Models/ViewBoardsBoardMessageJoined.cs index c362d53a..ad88ff74 100644 --- a/Migration.Toolkit.K11/Models/ViewBoardsBoardMessageJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewBoardsBoardMessageJoined.cs @@ -1,159 +1,159 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Toolkit.K11/Models/ViewCmsAclitemItemsAndOperator.cs index be9d3ca6..d774ede3 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsAclitemItemsAndOperator.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsAclitemItemsAndOperator.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.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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs index 046931b3..fa7912d3 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs @@ -1,124 +1,124 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs index 89ffdc0f..f0a00911 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs @@ -1,58 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsRelationshipJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsRelationshipJoined.cs index 30d170ef..377a3e47 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsRelationshipJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsRelationshipJoined.cs @@ -1,51 +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 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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsResourceStringJoined.cs index ede08b9e..9ef28bf0 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsResourceStringJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsResourceStringJoined.cs @@ -1,44 +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 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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsResourceTranslatedJoined.cs index 39be8ce8..0f0572f2 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsResourceTranslatedJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsResourceTranslatedJoined.cs @@ -1,28 +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 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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsRoleResourcePermissionJoined.cs index b56373da..d8271bdb 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsRoleResourcePermissionJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsRoleResourcePermissionJoined.cs @@ -1,23 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsSiteDocumentCount.cs b/Migration.Toolkit.K11/Models/ViewCmsSiteDocumentCount.cs index 489eb377..5ab3e55f 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsSiteDocumentCount.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsSiteDocumentCount.cs @@ -1,47 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs index 98060ff7..c9c64455 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs @@ -1,29 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsTreeJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsTreeJoined.cs index f76761cf..7941ed1a 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsTreeJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsTreeJoined.cs @@ -1,292 +1,292 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsUser.cs b/Migration.Toolkit.K11/Models/ViewCmsUser.cs index 29be3585..a78294a9 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUser.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUser.cs @@ -1,218 +1,218 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserDocument.cs b/Migration.Toolkit.K11/Models/ViewCmsUserDocument.cs index ed76d469..cc437659 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUserDocument.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUserDocument.cs @@ -1,56 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserRoleJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsUserRoleJoined.cs index 9fb7f4f0..61b8fa53 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUserRoleJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUserRoleJoined.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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRole.cs index 391a4a89..22095672 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRole.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRole.cs @@ -1,25 +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 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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs index 99ae5481..1c426e98 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs @@ -1,19 +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] -public partial class ViewCmsUserRoleMembershipRoleValidOnlyJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsUserSettingsRoleJoined.cs index 13aba39f..2d6d76c0 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUserSettingsRoleJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUserSettingsRoleJoined.cs @@ -1,42 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs index b4d5316e..3b4921a2 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs @@ -1,68 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs index fccf2518..7f855666 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs @@ -1,64 +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 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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Toolkit.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs index 48d199b2..be513cc8 100644 --- a/Migration.Toolkit.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs @@ -1,64 +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 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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCommunityFriendFriend.cs b/Migration.Toolkit.K11/Models/ViewCommunityFriendFriend.cs index d65cdd76..a352d09f 100644 --- a/Migration.Toolkit.K11/Models/ViewCommunityFriendFriend.cs +++ b/Migration.Toolkit.K11/Models/ViewCommunityFriendFriend.cs @@ -1,244 +1,244 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCommunityFriendRequestedFriend.cs b/Migration.Toolkit.K11/Models/ViewCommunityFriendRequestedFriend.cs index 42c51603..cf08f872 100644 --- a/Migration.Toolkit.K11/Models/ViewCommunityFriendRequestedFriend.cs +++ b/Migration.Toolkit.K11/Models/ViewCommunityFriendRequestedFriend.cs @@ -1,244 +1,244 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCommunityGroup.cs b/Migration.Toolkit.K11/Models/ViewCommunityGroup.cs index 51d7e3a4..41c66ad8 100644 --- a/Migration.Toolkit.K11/Models/ViewCommunityGroup.cs +++ b/Migration.Toolkit.K11/Models/ViewCommunityGroup.cs @@ -1,67 +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 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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewCommunityMember.cs b/Migration.Toolkit.K11/Models/ViewCommunityMember.cs index 637788d7..d263c7aa 100644 --- a/Migration.Toolkit.K11/Models/ViewCommunityMember.cs +++ b/Migration.Toolkit.K11/Models/ViewCommunityMember.cs @@ -1,249 +1,249 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewForumsGroupForumPostJoined.cs b/Migration.Toolkit.K11/Models/ViewForumsGroupForumPostJoined.cs index 6d98d748..d3d7669f 100644 --- a/Migration.Toolkit.K11/Models/ViewForumsGroupForumPostJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewForumsGroupForumPostJoined.cs @@ -1,228 +1,228 @@ -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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewIntegrationTaskJoined.cs b/Migration.Toolkit.K11/Models/ViewIntegrationTaskJoined.cs index 6fd03d90..d8f60e2b 100644 --- a/Migration.Toolkit.K11/Models/ViewIntegrationTaskJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewIntegrationTaskJoined.cs @@ -1,65 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Toolkit.K11/Models/ViewMembershipMembershipUserJoined.cs index ff957452..54b2208a 100644 --- a/Migration.Toolkit.K11/Models/ViewMembershipMembershipUserJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewMembershipMembershipUserJoined.cs @@ -1,31 +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 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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewMessagingContactList.cs b/Migration.Toolkit.K11/Models/ViewMessagingContactList.cs index fcbfd044..e973a903 100644 --- a/Migration.Toolkit.K11/Models/ViewMessagingContactList.cs +++ b/Migration.Toolkit.K11/Models/ViewMessagingContactList.cs @@ -1,34 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewMessagingIgnoreList.cs b/Migration.Toolkit.K11/Models/ViewMessagingIgnoreList.cs index 1f88a114..46f7a142 100644 --- a/Migration.Toolkit.K11/Models/ViewMessagingIgnoreList.cs +++ b/Migration.Toolkit.K11/Models/ViewMessagingIgnoreList.cs @@ -1,26 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Toolkit.K11/Models/ViewNewsletterSubscriptionsJoined.cs index 875e0ae3..436c1646 100644 --- a/Migration.Toolkit.K11/Models/ViewNewsletterSubscriptionsJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewNewsletterSubscriptionsJoined.cs @@ -1,39 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.K11/Models/ViewOmAccountContactAccountJoined.cs index 4104c53f..4447ca89 100644 --- a/Migration.Toolkit.K11/Models/ViewOmAccountContactAccountJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewOmAccountContactAccountJoined.cs @@ -1,32 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.K11/Models/ViewOmAccountContactContactJoined.cs index c50e3f4d..437832a5 100644 --- a/Migration.Toolkit.K11/Models/ViewOmAccountContactContactJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewOmAccountContactContactJoined.cs @@ -1,41 +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 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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.K11/Models/ViewOmAccountJoined.cs index 85ecf298..26b7f8c5 100644 --- a/Migration.Toolkit.K11/Models/ViewOmAccountJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewOmAccountJoined.cs @@ -1,102 +1,102 @@ -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!; -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberAccountJoined.cs index 0f3059bd..58b9f7bc 100644 --- a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberAccountJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -1,78 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberContactJoined.cs b/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberContactJoined.cs index 9339cd3b..fe59973a 100644 --- a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberContactJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberContactJoined.cs @@ -1,101 +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 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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewPollAnswerCount.cs b/Migration.Toolkit.K11/Models/ViewPollAnswerCount.cs index 612c521f..aeef0bec 100644 --- a/Migration.Toolkit.K11/Models/ViewPollAnswerCount.cs +++ b/Migration.Toolkit.K11/Models/ViewPollAnswerCount.cs @@ -1,52 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.K11/Models/ViewReportingCategoryReportJoined.cs b/Migration.Toolkit.K11/Models/ViewReportingCategoryReportJoined.cs index 0dd230e6..4734e9b7 100644 --- a/Migration.Toolkit.K11/Models/ViewReportingCategoryReportJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewReportingCategoryReportJoined.cs @@ -1,52 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.K11/SettingsKeys.cs b/Migration.Toolkit.K11/SettingsKeys.cs index bdbdcf70..e56a2578 100644 --- a/Migration.Toolkit.K11/SettingsKeys.cs +++ b/Migration.Toolkit.K11/SettingsKeys.cs @@ -1,748 +1,749 @@ -// 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"; +// 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 diff --git a/Migration.Toolkit.KX12/Auxiliary/Kx13FormControls.cs b/Migration.Toolkit.KX12/Auxiliary/Kx13FormControls.cs index 5a046cd0..9e2f05fa 100644 --- a/Migration.Toolkit.KX12/Auxiliary/Kx13FormControls.cs +++ b/Migration.Toolkit.KX12/Auxiliary/Kx13FormControls.cs @@ -1,233 +1,233 @@ -// 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"; - } +// 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 diff --git a/Migration.Toolkit.KX12/Context/KX12Context.cs b/Migration.Toolkit.KX12/Context/KX12Context.cs index d44b7aa9..f4ee8503 100644 --- a/Migration.Toolkit.KX12/Context/KX12Context.cs +++ b/Migration.Toolkit.KX12/Context/KX12Context.cs @@ -1,5223 +1,5223 @@ -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); -} +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 diff --git a/Migration.Toolkit.KX12/ContextCustomizations.cs b/Migration.Toolkit.KX12/ContextCustomizations.cs index 28d4915a..6d322907 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); - } +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 diff --git a/Migration.Toolkit.KX12/DependencyInjectionExtensions.cs b/Migration.Toolkit.KX12/DependencyInjectionExtensions.cs index 45ae5acf..7a47a4ec 100644 --- a/Migration.Toolkit.KX12/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.KX12/DependencyInjectionExtensions.cs @@ -1,15 +1,15 @@ -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; - } +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaign.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaign.cs index acc60bac..e73fc1f4 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaign.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaign.cs @@ -1,74 +1,74 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAsset.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignAsset.cs index 685082ff..e7fd055d 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAsset.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaignAsset.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignAssetUrl.cs index cd35389b..438936c1 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAssetUrl.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaignAssetUrl.cs @@ -1,30 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversion.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversion.cs index d193c3ee..7107488b 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversion.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversion.cs @@ -1,56 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversionHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversionHit.cs index f606461e..c7b6ed4c 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversionHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversionHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignObjective.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignObjective.cs index ec3d72ca..9bf23a8d 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignObjective.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaignObjective.cs @@ -1,37 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsConversion.cs b/Migration.Toolkit.KX12/Models/AnalyticsConversion.cs index 3559fd62..50c210aa 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsConversion.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsConversion.cs @@ -1,36 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsDayHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsDayHit.cs index 402a548b..9ac49fc6 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsDayHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsDayHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsExitPage.cs b/Migration.Toolkit.KX12/Models/AnalyticsExitPage.cs index 727ccb19..bc8d0a04 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsExitPage.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsExitPage.cs @@ -1,27 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsHourHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsHourHit.cs index 0d86bfb8..731cc103 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsHourHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsHourHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsMonthHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsMonthHit.cs index 3c597a38..6c2249ee 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsMonthHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsMonthHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsStatistic.cs b/Migration.Toolkit.KX12/Models/AnalyticsStatistic.cs index 02a47170..3c367b89 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsStatistic.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsStatistic.cs @@ -1,50 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsWeekHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsWeekHit.cs index 325547d3..c8cea73a 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsWeekHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsWeekHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/AnalyticsYearHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsYearHit.cs index 92975a8e..eabc35dc 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsYearHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsYearHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/BadWordsWord.cs b/Migration.Toolkit.KX12/Models/BadWordsWord.cs index f93edd98..4e0a875d 100644 --- a/Migration.Toolkit.KX12/Models/BadWordsWord.cs +++ b/Migration.Toolkit.KX12/Models/BadWordsWord.cs @@ -1,39 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/BlogComment.cs b/Migration.Toolkit.KX12/Models/BlogComment.cs index 73601940..5aff6dbc 100644 --- a/Migration.Toolkit.KX12/Models/BlogComment.cs +++ b/Migration.Toolkit.KX12/Models/BlogComment.cs @@ -1,61 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/BlogPostSubscription.cs b/Migration.Toolkit.KX12/Models/BlogPostSubscription.cs index 76ce3c56..33c20d58 100644 --- a/Migration.Toolkit.KX12/Models/BlogPostSubscription.cs +++ b/Migration.Toolkit.KX12/Models/BlogPostSubscription.cs @@ -1,44 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/BoardBoard.cs b/Migration.Toolkit.KX12/Models/BoardBoard.cs index b180d6d3..29bfce38 100644 --- a/Migration.Toolkit.KX12/Models/BoardBoard.cs +++ b/Migration.Toolkit.KX12/Models/BoardBoard.cs @@ -1,117 +1,117 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/BoardMessage.cs b/Migration.Toolkit.KX12/Models/BoardMessage.cs index 797b151e..7894d01a 100644 --- a/Migration.Toolkit.KX12/Models/BoardMessage.cs +++ b/Migration.Toolkit.KX12/Models/BoardMessage.cs @@ -1,70 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/BoardSubscription.cs b/Migration.Toolkit.KX12/Models/BoardSubscription.cs index 81c5c891..6fffd986 100644 --- a/Migration.Toolkit.KX12/Models/BoardSubscription.cs +++ b/Migration.Toolkit.KX12/Models/BoardSubscription.cs @@ -1,44 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ChatInitiatedChatRequest.cs b/Migration.Toolkit.KX12/Models/ChatInitiatedChatRequest.cs index 0eee51be..f58cd3c4 100644 --- a/Migration.Toolkit.KX12/Models/ChatInitiatedChatRequest.cs +++ b/Migration.Toolkit.KX12/Models/ChatInitiatedChatRequest.cs @@ -1,50 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ChatMessage.cs b/Migration.Toolkit.KX12/Models/ChatMessage.cs index bafd16f5..538997e2 100644 --- a/Migration.Toolkit.KX12/Models/ChatMessage.cs +++ b/Migration.Toolkit.KX12/Models/ChatMessage.cs @@ -1,54 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ChatNotification.cs b/Migration.Toolkit.KX12/Models/ChatNotification.cs index c23bd798..18ac0eec 100644 --- a/Migration.Toolkit.KX12/Models/ChatNotification.cs +++ b/Migration.Toolkit.KX12/Models/ChatNotification.cs @@ -1,55 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ChatOnlineSupport.cs b/Migration.Toolkit.KX12/Models/ChatOnlineSupport.cs index d281ade8..1a3ef89c 100644 --- a/Migration.Toolkit.KX12/Models/ChatOnlineSupport.cs +++ b/Migration.Toolkit.KX12/Models/ChatOnlineSupport.cs @@ -1,37 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ChatOnlineUser.cs b/Migration.Toolkit.KX12/Models/ChatOnlineUser.cs index 24801900..91dcd35e 100644 --- a/Migration.Toolkit.KX12/Models/ChatOnlineUser.cs +++ b/Migration.Toolkit.KX12/Models/ChatOnlineUser.cs @@ -1,43 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ChatPopupWindowSetting.cs b/Migration.Toolkit.KX12/Models/ChatPopupWindowSetting.cs index c3319300..b0ced73f 100644 --- a/Migration.Toolkit.KX12/Models/ChatPopupWindowSetting.cs +++ b/Migration.Toolkit.KX12/Models/ChatPopupWindowSetting.cs @@ -1,29 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ChatRoom.cs b/Migration.Toolkit.KX12/Models/ChatRoom.cs index e244c2f4..ece1a022 100644 --- a/Migration.Toolkit.KX12/Models/ChatRoom.cs +++ b/Migration.Toolkit.KX12/Models/ChatRoom.cs @@ -1,81 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ChatRoomUser.cs b/Migration.Toolkit.KX12/Models/ChatRoomUser.cs index 4859409d..b3302424 100644 --- a/Migration.Toolkit.KX12/Models/ChatRoomUser.cs +++ b/Migration.Toolkit.KX12/Models/ChatRoomUser.cs @@ -1,44 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ChatSupportCannedResponse.cs b/Migration.Toolkit.KX12/Models/ChatSupportCannedResponse.cs index 663e8279..80890ec6 100644 --- a/Migration.Toolkit.KX12/Models/ChatSupportCannedResponse.cs +++ b/Migration.Toolkit.KX12/Models/ChatSupportCannedResponse.cs @@ -1,40 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ChatSupportTakenRoom.cs b/Migration.Toolkit.KX12/Models/ChatSupportTakenRoom.cs index 1b20de1a..8d5c5970 100644 --- a/Migration.Toolkit.KX12/Models/ChatSupportTakenRoom.cs +++ b/Migration.Toolkit.KX12/Models/ChatSupportTakenRoom.cs @@ -1,35 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ChatUser.cs b/Migration.Toolkit.KX12/Models/ChatUser.cs index 200431c5..190968c6 100644 --- a/Migration.Toolkit.KX12/Models/ChatUser.cs +++ b/Migration.Toolkit.KX12/Models/ChatUser.cs @@ -1,61 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CiFileMetadatum.cs b/Migration.Toolkit.KX12/Models/CiFileMetadatum.cs index 752c8c15..72fe25ff 100644 --- a/Migration.Toolkit.KX12/Models/CiFileMetadatum.cs +++ b/Migration.Toolkit.KX12/Models/CiFileMetadatum.cs @@ -1,22 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CiMigration.cs b/Migration.Toolkit.KX12/Models/CiMigration.cs index 47591810..9f191d87 100644 --- a/Migration.Toolkit.KX12/Models/CiMigration.cs +++ b/Migration.Toolkit.KX12/Models/CiMigration.cs @@ -1,24 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsAbuseReport.cs b/Migration.Toolkit.KX12/Models/CmsAbuseReport.cs index 3fa980c5..11de55ca 100644 --- a/Migration.Toolkit.KX12/Models/CmsAbuseReport.cs +++ b/Migration.Toolkit.KX12/Models/CmsAbuseReport.cs @@ -1,57 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsAcl.cs b/Migration.Toolkit.KX12/Models/CmsAcl.cs index 49aa857b..a4dc620e 100644 --- a/Migration.Toolkit.KX12/Models/CmsAcl.cs +++ b/Migration.Toolkit.KX12/Models/CmsAcl.cs @@ -1,39 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsAclitem.cs b/Migration.Toolkit.KX12/Models/CmsAclitem.cs index 66480d29..72e366bf 100644 --- a/Migration.Toolkit.KX12/Models/CmsAclitem.cs +++ b/Migration.Toolkit.KX12/Models/CmsAclitem.cs @@ -1,56 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsAlternativeForm.cs b/Migration.Toolkit.KX12/Models/CmsAlternativeForm.cs index 5c63b5ed..c330e57e 100644 --- a/Migration.Toolkit.KX12/Models/CmsAlternativeForm.cs +++ b/Migration.Toolkit.KX12/Models/CmsAlternativeForm.cs @@ -1,60 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsAlternativeUrl.cs b/Migration.Toolkit.KX12/Models/CmsAlternativeUrl.cs index cb03b966..030d8dff 100644 --- a/Migration.Toolkit.KX12/Models/CmsAlternativeUrl.cs +++ b/Migration.Toolkit.KX12/Models/CmsAlternativeUrl.cs @@ -1,38 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsAttachment.cs b/Migration.Toolkit.KX12/Models/CmsAttachment.cs index 33a2e9ac..2bd9e99f 100644 --- a/Migration.Toolkit.KX12/Models/CmsAttachment.cs +++ b/Migration.Toolkit.KX12/Models/CmsAttachment.cs @@ -1,91 +1,91 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsAttachmentHistory.cs b/Migration.Toolkit.KX12/Models/CmsAttachmentHistory.cs index 5e1844e5..22052ae3 100644 --- a/Migration.Toolkit.KX12/Models/CmsAttachmentHistory.cs +++ b/Migration.Toolkit.KX12/Models/CmsAttachmentHistory.cs @@ -1,90 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsAutomationHistory.cs b/Migration.Toolkit.KX12/Models/CmsAutomationHistory.cs index 7f3d9fba..19aee3c0 100644 --- a/Migration.Toolkit.KX12/Models/CmsAutomationHistory.cs +++ b/Migration.Toolkit.KX12/Models/CmsAutomationHistory.cs @@ -1,82 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsAutomationState.cs b/Migration.Toolkit.KX12/Models/CmsAutomationState.cs index d0904502..8c1516d1 100644 --- a/Migration.Toolkit.KX12/Models/CmsAutomationState.cs +++ b/Migration.Toolkit.KX12/Models/CmsAutomationState.cs @@ -1,71 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsAvatar.cs b/Migration.Toolkit.KX12/Models/CmsAvatar.cs index 47d0e160..b4f5df87 100644 --- a/Migration.Toolkit.KX12/Models/CmsAvatar.cs +++ b/Migration.Toolkit.KX12/Models/CmsAvatar.cs @@ -1,61 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsBadge.cs b/Migration.Toolkit.KX12/Models/CmsBadge.cs index 10702c98..66b42199 100644 --- a/Migration.Toolkit.KX12/Models/CmsBadge.cs +++ b/Migration.Toolkit.KX12/Models/CmsBadge.cs @@ -1,37 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsBannedIp.cs b/Migration.Toolkit.KX12/Models/CmsBannedIp.cs index 1a525d91..ee10c1be 100644 --- a/Migration.Toolkit.KX12/Models/CmsBannedIp.cs +++ b/Migration.Toolkit.KX12/Models/CmsBannedIp.cs @@ -1,54 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsBanner.cs b/Migration.Toolkit.KX12/Models/CmsBanner.cs index 3c5fd038..5e4cb93c 100644 --- a/Migration.Toolkit.KX12/Models/CmsBanner.cs +++ b/Migration.Toolkit.KX12/Models/CmsBanner.cs @@ -1,64 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsBannerCategory.cs b/Migration.Toolkit.KX12/Models/CmsBannerCategory.cs index ffbc9d2b..273e924d 100644 --- a/Migration.Toolkit.KX12/Models/CmsBannerCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsBannerCategory.cs @@ -1,40 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsCategory.cs b/Migration.Toolkit.KX12/Models/CmsCategory.cs index 6ec2c3af..9f77ad92 100644 --- a/Migration.Toolkit.KX12/Models/CmsCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsCategory.cs @@ -1,67 +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; - -[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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsClass.cs b/Migration.Toolkit.KX12/Models/CmsClass.cs index 3b612695..d60af7e3 100644 --- a/Migration.Toolkit.KX12/Models/CmsClass.cs +++ b/Migration.Toolkit.KX12/Models/CmsClass.cs @@ -1,221 +1,221 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsConsent.cs b/Migration.Toolkit.KX12/Models/CmsConsent.cs index ebfa9265..c36d2e91 100644 --- a/Migration.Toolkit.KX12/Models/CmsConsent.cs +++ b/Migration.Toolkit.KX12/Models/CmsConsent.cs @@ -1,36 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsConsentAgreement.cs b/Migration.Toolkit.KX12/Models/CmsConsentAgreement.cs index d22c1c09..8690fa2c 100644 --- a/Migration.Toolkit.KX12/Models/CmsConsentAgreement.cs +++ b/Migration.Toolkit.KX12/Models/CmsConsentAgreement.cs @@ -1,39 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsConsentArchive.cs b/Migration.Toolkit.KX12/Models/CmsConsentArchive.cs index 224d4185..fa3d1391 100644 --- a/Migration.Toolkit.KX12/Models/CmsConsentArchive.cs +++ b/Migration.Toolkit.KX12/Models/CmsConsentArchive.cs @@ -1,32 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsCountry.cs b/Migration.Toolkit.KX12/Models/CmsCountry.cs index 8b9ef7aa..f90b9ea6 100644 --- a/Migration.Toolkit.KX12/Models/CmsCountry.cs +++ b/Migration.Toolkit.KX12/Models/CmsCountry.cs @@ -1,50 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsCssStylesheet.cs b/Migration.Toolkit.KX12/Models/CmsCssStylesheet.cs index d542ab1a..fedab3d2 100644 --- a/Migration.Toolkit.KX12/Models/CmsCssStylesheet.cs +++ b/Migration.Toolkit.KX12/Models/CmsCssStylesheet.cs @@ -1,50 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsCulture.cs b/Migration.Toolkit.KX12/Models/CmsCulture.cs index dcd14e56..753bb968 100644 --- a/Migration.Toolkit.KX12/Models/CmsCulture.cs +++ b/Migration.Toolkit.KX12/Models/CmsCulture.cs @@ -1,61 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsDeviceProfile.cs b/Migration.Toolkit.KX12/Models/CmsDeviceProfile.cs index fa49b2c4..9a28ac97 100644 --- a/Migration.Toolkit.KX12/Models/CmsDeviceProfile.cs +++ b/Migration.Toolkit.KX12/Models/CmsDeviceProfile.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.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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsDeviceProfileLayout.cs b/Migration.Toolkit.KX12/Models/CmsDeviceProfileLayout.cs index fd881046..b56676b2 100644 --- a/Migration.Toolkit.KX12/Models/CmsDeviceProfileLayout.cs +++ b/Migration.Toolkit.KX12/Models/CmsDeviceProfileLayout.cs @@ -1,44 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsDocument.cs b/Migration.Toolkit.KX12/Models/CmsDocument.cs index ffcfce0b..1b3b9b7b 100644 --- a/Migration.Toolkit.KX12/Models/CmsDocument.cs +++ b/Migration.Toolkit.KX12/Models/CmsDocument.cs @@ -1,294 +1,294 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsDocumentAlias.cs b/Migration.Toolkit.KX12/Models/CmsDocumentAlias.cs index fa3d504b..97625480 100644 --- a/Migration.Toolkit.KX12/Models/CmsDocumentAlias.cs +++ b/Migration.Toolkit.KX12/Models/CmsDocumentAlias.cs @@ -1,55 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsDocumentTypeScope.cs b/Migration.Toolkit.KX12/Models/CmsDocumentTypeScope.cs index 41dc8e80..4d87ac14 100644 --- a/Migration.Toolkit.KX12/Models/CmsDocumentTypeScope.cs +++ b/Migration.Toolkit.KX12/Models/CmsDocumentTypeScope.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.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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsEmail.cs b/Migration.Toolkit.KX12/Models/CmsEmail.cs index 331f0dc1..545b82ad 100644 --- a/Migration.Toolkit.KX12/Models/CmsEmail.cs +++ b/Migration.Toolkit.KX12/Models/CmsEmail.cs @@ -1,69 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsEmailAttachment.cs b/Migration.Toolkit.KX12/Models/CmsEmailAttachment.cs index 67cc3968..9f141cb6 100644 --- a/Migration.Toolkit.KX12/Models/CmsEmailAttachment.cs +++ b/Migration.Toolkit.KX12/Models/CmsEmailAttachment.cs @@ -1,44 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsEmailTemplate.cs b/Migration.Toolkit.KX12/Models/CmsEmailTemplate.cs index 7af64c90..d46e194b 100644 --- a/Migration.Toolkit.KX12/Models/CmsEmailTemplate.cs +++ b/Migration.Toolkit.KX12/Models/CmsEmailTemplate.cs @@ -1,59 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsEmailUser.cs b/Migration.Toolkit.KX12/Models/CmsEmailUser.cs index eab0733e..185c7e92 100644 --- a/Migration.Toolkit.KX12/Models/CmsEmailUser.cs +++ b/Migration.Toolkit.KX12/Models/CmsEmailUser.cs @@ -1,36 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsEventLog.cs b/Migration.Toolkit.KX12/Models/CmsEventLog.cs index 6552a6f9..49aea67e 100644 --- a/Migration.Toolkit.KX12/Models/CmsEventLog.cs +++ b/Migration.Toolkit.KX12/Models/CmsEventLog.cs @@ -1,57 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsExternalLogin.cs b/Migration.Toolkit.KX12/Models/CmsExternalLogin.cs index b194a2af..d3128692 100644 --- a/Migration.Toolkit.KX12/Models/CmsExternalLogin.cs +++ b/Migration.Toolkit.KX12/Models/CmsExternalLogin.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsForm.cs b/Migration.Toolkit.KX12/Models/CmsForm.cs index 90a36a25..0b238b65 100644 --- a/Migration.Toolkit.KX12/Models/CmsForm.cs +++ b/Migration.Toolkit.KX12/Models/CmsForm.cs @@ -1,95 +1,95 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsFormUserControl.cs b/Migration.Toolkit.KX12/Models/CmsFormUserControl.cs index 8a43e222..35ac02e8 100644 --- a/Migration.Toolkit.KX12/Models/CmsFormUserControl.cs +++ b/Migration.Toolkit.KX12/Models/CmsFormUserControl.cs @@ -1,109 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsHelpTopic.cs b/Migration.Toolkit.KX12/Models/CmsHelpTopic.cs index c5fc81ad..be4ea86f 100644 --- a/Migration.Toolkit.KX12/Models/CmsHelpTopic.cs +++ b/Migration.Toolkit.KX12/Models/CmsHelpTopic.cs @@ -1,38 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsLayout.cs b/Migration.Toolkit.KX12/Models/CmsLayout.cs index e9eedc50..883bbb61 100644 --- a/Migration.Toolkit.KX12/Models/CmsLayout.cs +++ b/Migration.Toolkit.KX12/Models/CmsLayout.cs @@ -1,63 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsLicenseKey.cs b/Migration.Toolkit.KX12/Models/CmsLicenseKey.cs index bd1a1ffd..0aa50dd3 100644 --- a/Migration.Toolkit.KX12/Models/CmsLicenseKey.cs +++ b/Migration.Toolkit.KX12/Models/CmsLicenseKey.cs @@ -1,28 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsMacroIdentity.cs b/Migration.Toolkit.KX12/Models/CmsMacroIdentity.cs index f9879b11..f174c505 100644 --- a/Migration.Toolkit.KX12/Models/CmsMacroIdentity.cs +++ b/Migration.Toolkit.KX12/Models/CmsMacroIdentity.cs @@ -1,33 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsMacroRule.cs b/Migration.Toolkit.KX12/Models/CmsMacroRule.cs index aeefbef5..cd58722c 100644 --- a/Migration.Toolkit.KX12/Models/CmsMacroRule.cs +++ b/Migration.Toolkit.KX12/Models/CmsMacroRule.cs @@ -1,50 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsMembership.cs b/Migration.Toolkit.KX12/Models/CmsMembership.cs index 49b69d68..c7a305df 100644 --- a/Migration.Toolkit.KX12/Models/CmsMembership.cs +++ b/Migration.Toolkit.KX12/Models/CmsMembership.cs @@ -1,43 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsMembershipUser.cs b/Migration.Toolkit.KX12/Models/CmsMembershipUser.cs index 6d3f8bec..ecbc1938 100644 --- a/Migration.Toolkit.KX12/Models/CmsMembershipUser.cs +++ b/Migration.Toolkit.KX12/Models/CmsMembershipUser.cs @@ -1,35 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsMetaFile.cs b/Migration.Toolkit.KX12/Models/CmsMetaFile.cs index f00a2d86..a3a8638e 100644 --- a/Migration.Toolkit.KX12/Models/CmsMetaFile.cs +++ b/Migration.Toolkit.KX12/Models/CmsMetaFile.cs @@ -1,62 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsModuleLicenseKey.cs b/Migration.Toolkit.KX12/Models/CmsModuleLicenseKey.cs index 3a1d5cb8..60a3fead 100644 --- a/Migration.Toolkit.KX12/Models/CmsModuleLicenseKey.cs +++ b/Migration.Toolkit.KX12/Models/CmsModuleLicenseKey.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsModuleUsageCounter.cs b/Migration.Toolkit.KX12/Models/CmsModuleUsageCounter.cs index 433787b3..563c3f04 100644 --- a/Migration.Toolkit.KX12/Models/CmsModuleUsageCounter.cs +++ b/Migration.Toolkit.KX12/Models/CmsModuleUsageCounter.cs @@ -1,20 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsObjectSetting.cs b/Migration.Toolkit.KX12/Models/CmsObjectSetting.cs index a1535c89..5da3cfc6 100644 --- a/Migration.Toolkit.KX12/Models/CmsObjectSetting.cs +++ b/Migration.Toolkit.KX12/Models/CmsObjectSetting.cs @@ -1,62 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsObjectVersionHistory.cs b/Migration.Toolkit.KX12/Models/CmsObjectVersionHistory.cs index cc0f9c77..0e321dda 100644 --- a/Migration.Toolkit.KX12/Models/CmsObjectVersionHistory.cs +++ b/Migration.Toolkit.KX12/Models/CmsObjectVersionHistory.cs @@ -1,73 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.KX12/Models/CmsObjectWorkflowTrigger.cs index 10cf2a97..aba1bb7f 100644 --- a/Migration.Toolkit.KX12/Models/CmsObjectWorkflowTrigger.cs +++ b/Migration.Toolkit.KX12/Models/CmsObjectWorkflowTrigger.cs @@ -1,46 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsOpenIduser.cs b/Migration.Toolkit.KX12/Models/CmsOpenIduser.cs index 7887e50a..6bbf655a 100644 --- a/Migration.Toolkit.KX12/Models/CmsOpenIduser.cs +++ b/Migration.Toolkit.KX12/Models/CmsOpenIduser.cs @@ -1,31 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplate.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplate.cs index e13828b2..77e1fcf3 100644 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplate.cs +++ b/Migration.Toolkit.KX12/Models/CmsPageTemplate.cs @@ -1,136 +1,136 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplateCategory.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplateCategory.cs index 5b3693b8..903c65b9 100644 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplateCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsPageTemplateCategory.cs @@ -1,55 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplateConfiguration.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplateConfiguration.cs index c6440613..b66db74e 100644 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplateConfiguration.cs +++ b/Migration.Toolkit.KX12/Models/CmsPageTemplateConfiguration.cs @@ -1,40 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplateScope.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplateScope.cs index af8ed0aa..b9637852 100644 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplateScope.cs +++ b/Migration.Toolkit.KX12/Models/CmsPageTemplateScope.cs @@ -1,57 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsPermission.cs b/Migration.Toolkit.KX12/Models/CmsPermission.cs index a0ba330f..e1168bbf 100644 --- a/Migration.Toolkit.KX12/Models/CmsPermission.cs +++ b/Migration.Toolkit.KX12/Models/CmsPermission.cs @@ -1,66 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsPersonalization.cs b/Migration.Toolkit.KX12/Models/CmsPersonalization.cs index 633b9e1b..0e0c2a56 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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsQuery.cs b/Migration.Toolkit.KX12/Models/CmsQuery.cs index dfa9a7a6..fecffa57 100644 --- a/Migration.Toolkit.KX12/Models/CmsQuery.cs +++ b/Migration.Toolkit.KX12/Models/CmsQuery.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.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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsRelationship.cs b/Migration.Toolkit.KX12/Models/CmsRelationship.cs index 2baa668c..0bbc060a 100644 --- a/Migration.Toolkit.KX12/Models/CmsRelationship.cs +++ b/Migration.Toolkit.KX12/Models/CmsRelationship.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.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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsRelationshipName.cs b/Migration.Toolkit.KX12/Models/CmsRelationshipName.cs index adeb1b65..78c0eac6 100644 --- a/Migration.Toolkit.KX12/Models/CmsRelationshipName.cs +++ b/Migration.Toolkit.KX12/Models/CmsRelationshipName.cs @@ -1,39 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsResource.cs b/Migration.Toolkit.KX12/Models/CmsResource.cs index 1cf7af14..c94c700d 100644 --- a/Migration.Toolkit.KX12/Models/CmsResource.cs +++ b/Migration.Toolkit.KX12/Models/CmsResource.cs @@ -1,85 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsResourceLibrary.cs b/Migration.Toolkit.KX12/Models/CmsResourceLibrary.cs index bd4ecfad..0049e857 100644 --- a/Migration.Toolkit.KX12/Models/CmsResourceLibrary.cs +++ b/Migration.Toolkit.KX12/Models/CmsResourceLibrary.cs @@ -1,26 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsResourceString.cs b/Migration.Toolkit.KX12/Models/CmsResourceString.cs index d661e0a7..1bcb23d1 100644 --- a/Migration.Toolkit.KX12/Models/CmsResourceString.cs +++ b/Migration.Toolkit.KX12/Models/CmsResourceString.cs @@ -1,27 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsResourceTranslation.cs b/Migration.Toolkit.KX12/Models/CmsResourceTranslation.cs index 9da24ef2..bc08911f 100644 --- a/Migration.Toolkit.KX12/Models/CmsResourceTranslation.cs +++ b/Migration.Toolkit.KX12/Models/CmsResourceTranslation.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsRole.cs b/Migration.Toolkit.KX12/Models/CmsRole.cs index d9e66f2f..e83b945f 100644 --- a/Migration.Toolkit.KX12/Models/CmsRole.cs +++ b/Migration.Toolkit.KX12/Models/CmsRole.cs @@ -1,98 +1,98 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsScheduledTask.cs b/Migration.Toolkit.KX12/Models/CmsScheduledTask.cs index 8875c095..fedd7c9d 100644 --- a/Migration.Toolkit.KX12/Models/CmsScheduledTask.cs +++ b/Migration.Toolkit.KX12/Models/CmsScheduledTask.cs @@ -1,112 +1,112 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsSearchEngine.cs b/Migration.Toolkit.KX12/Models/CmsSearchEngine.cs index 8b1a0850..1ff3570d 100644 --- a/Migration.Toolkit.KX12/Models/CmsSearchEngine.cs +++ b/Migration.Toolkit.KX12/Models/CmsSearchEngine.cs @@ -1,35 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsSearchIndex.cs b/Migration.Toolkit.KX12/Models/CmsSearchIndex.cs index b30cf321..a65a6ac5 100644 --- a/Migration.Toolkit.KX12/Models/CmsSearchIndex.cs +++ b/Migration.Toolkit.KX12/Models/CmsSearchIndex.cs @@ -1,88 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsSearchTask.cs b/Migration.Toolkit.KX12/Models/CmsSearchTask.cs index cab0c689..62084292 100644 --- a/Migration.Toolkit.KX12/Models/CmsSearchTask.cs +++ b/Migration.Toolkit.KX12/Models/CmsSearchTask.cs @@ -1,42 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsSearchTaskAzure.cs b/Migration.Toolkit.KX12/Models/CmsSearchTaskAzure.cs index c3f5babd..cbe90045 100644 --- a/Migration.Toolkit.KX12/Models/CmsSearchTaskAzure.cs +++ b/Migration.Toolkit.KX12/Models/CmsSearchTaskAzure.cs @@ -1,37 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsSession.cs b/Migration.Toolkit.KX12/Models/CmsSession.cs index 927a72c8..f2a80e9f 100644 --- a/Migration.Toolkit.KX12/Models/CmsSession.cs +++ b/Migration.Toolkit.KX12/Models/CmsSession.cs @@ -1,66 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsSettingsCategory.cs b/Migration.Toolkit.KX12/Models/CmsSettingsCategory.cs index fdb05b79..7175d95f 100644 --- a/Migration.Toolkit.KX12/Models/CmsSettingsCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsSettingsCategory.cs @@ -1,60 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsSettingsKey.cs b/Migration.Toolkit.KX12/Models/CmsSettingsKey.cs index eaf1c37f..b9a10ceb 100644 --- a/Migration.Toolkit.KX12/Models/CmsSettingsKey.cs +++ b/Migration.Toolkit.KX12/Models/CmsSettingsKey.cs @@ -1,69 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsSite.cs b/Migration.Toolkit.KX12/Models/CmsSite.cs index 42380aea..cfb63d59 100644 --- a/Migration.Toolkit.KX12/Models/CmsSite.cs +++ b/Migration.Toolkit.KX12/Models/CmsSite.cs @@ -1,414 +1,414 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsSiteDomainAlias.cs b/Migration.Toolkit.KX12/Models/CmsSiteDomainAlias.cs index a828e5d7..872ceaff 100644 --- a/Migration.Toolkit.KX12/Models/CmsSiteDomainAlias.cs +++ b/Migration.Toolkit.KX12/Models/CmsSiteDomainAlias.cs @@ -1,41 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsSmtpserver.cs b/Migration.Toolkit.KX12/Models/CmsSmtpserver.cs index c9a37884..7cbdab43 100644 --- a/Migration.Toolkit.KX12/Models/CmsSmtpserver.cs +++ b/Migration.Toolkit.KX12/Models/CmsSmtpserver.cs @@ -1,47 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsState.cs b/Migration.Toolkit.KX12/Models/CmsState.cs index 89eb004e..23ef9a90 100644 --- a/Migration.Toolkit.KX12/Models/CmsState.cs +++ b/Migration.Toolkit.KX12/Models/CmsState.cs @@ -1,53 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsTag.cs b/Migration.Toolkit.KX12/Models/CmsTag.cs index 14d21d21..21a4a6b7 100644 --- a/Migration.Toolkit.KX12/Models/CmsTag.cs +++ b/Migration.Toolkit.KX12/Models/CmsTag.cs @@ -1,35 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsTagGroup.cs b/Migration.Toolkit.KX12/Models/CmsTagGroup.cs index d7d6ce5b..784f91dd 100644 --- a/Migration.Toolkit.KX12/Models/CmsTagGroup.cs +++ b/Migration.Toolkit.KX12/Models/CmsTagGroup.cs @@ -1,44 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsTemplateDeviceLayout.cs b/Migration.Toolkit.KX12/Models/CmsTemplateDeviceLayout.cs index 6424d71a..291372d9 100644 --- a/Migration.Toolkit.KX12/Models/CmsTemplateDeviceLayout.cs +++ b/Migration.Toolkit.KX12/Models/CmsTemplateDeviceLayout.cs @@ -1,56 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsTimeZone.cs b/Migration.Toolkit.KX12/Models/CmsTimeZone.cs index c2aa5672..5d5d7563 100644 --- a/Migration.Toolkit.KX12/Models/CmsTimeZone.cs +++ b/Migration.Toolkit.KX12/Models/CmsTimeZone.cs @@ -1,44 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsTransformation.cs b/Migration.Toolkit.KX12/Models/CmsTransformation.cs index 486d01d5..9e0feb94 100644 --- a/Migration.Toolkit.KX12/Models/CmsTransformation.cs +++ b/Migration.Toolkit.KX12/Models/CmsTransformation.cs @@ -1,51 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsTranslationService.cs b/Migration.Toolkit.KX12/Models/CmsTranslationService.cs index 23833c72..659d6b53 100644 --- a/Migration.Toolkit.KX12/Models/CmsTranslationService.cs +++ b/Migration.Toolkit.KX12/Models/CmsTranslationService.cs @@ -1,54 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsTranslationSubmission.cs b/Migration.Toolkit.KX12/Models/CmsTranslationSubmission.cs index 6eb90ccc..91f6a264 100644 --- a/Migration.Toolkit.KX12/Models/CmsTranslationSubmission.cs +++ b/Migration.Toolkit.KX12/Models/CmsTranslationSubmission.cs @@ -1,76 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsTranslationSubmissionItem.cs b/Migration.Toolkit.KX12/Models/CmsTranslationSubmissionItem.cs index 6c57462a..329d67f0 100644 --- a/Migration.Toolkit.KX12/Models/CmsTranslationSubmissionItem.cs +++ b/Migration.Toolkit.KX12/Models/CmsTranslationSubmissionItem.cs @@ -1,58 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsTree.cs b/Migration.Toolkit.KX12/Models/CmsTree.cs index c5122201..ae9acbac 100644 --- a/Migration.Toolkit.KX12/Models/CmsTree.cs +++ b/Migration.Toolkit.KX12/Models/CmsTree.cs @@ -1,184 +1,184 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsUielement.cs b/Migration.Toolkit.KX12/Models/CmsUielement.cs index f610aee7..b63198de 100644 --- a/Migration.Toolkit.KX12/Models/CmsUielement.cs +++ b/Migration.Toolkit.KX12/Models/CmsUielement.cs @@ -1,116 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsUser.cs b/Migration.Toolkit.KX12/Models/CmsUser.cs index a50ab59b..feb20825 100644 --- a/Migration.Toolkit.KX12/Models/CmsUser.cs +++ b/Migration.Toolkit.KX12/Models/CmsUser.cs @@ -1,306 +1,306 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsUserCulture.cs b/Migration.Toolkit.KX12/Models/CmsUserCulture.cs index 7d59dc95..9820849e 100644 --- a/Migration.Toolkit.KX12/Models/CmsUserCulture.cs +++ b/Migration.Toolkit.KX12/Models/CmsUserCulture.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.KX12/Models/CmsUserMacroIdentity.cs index f937dad0..45021856 100644 --- a/Migration.Toolkit.KX12/Models/CmsUserMacroIdentity.cs +++ b/Migration.Toolkit.KX12/Models/CmsUserMacroIdentity.cs @@ -1,35 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsUserRole.cs b/Migration.Toolkit.KX12/Models/CmsUserRole.cs index 9b1fd362..61d5cdec 100644 --- a/Migration.Toolkit.KX12/Models/CmsUserRole.cs +++ b/Migration.Toolkit.KX12/Models/CmsUserRole.cs @@ -1,34 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsUserSetting.cs b/Migration.Toolkit.KX12/Models/CmsUserSetting.cs index bcb964c7..c7a1f8c0 100644 --- a/Migration.Toolkit.KX12/Models/CmsUserSetting.cs +++ b/Migration.Toolkit.KX12/Models/CmsUserSetting.cs @@ -1,168 +1,168 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsUserSite.cs b/Migration.Toolkit.KX12/Models/CmsUserSite.cs index a58af31d..b160ca9d 100644 --- a/Migration.Toolkit.KX12/Models/CmsUserSite.cs +++ b/Migration.Toolkit.KX12/Models/CmsUserSite.cs @@ -1,31 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsVersionHistory.cs b/Migration.Toolkit.KX12/Models/CmsVersionHistory.cs index 6871bdbd..68202ff2 100644 --- a/Migration.Toolkit.KX12/Models/CmsVersionHistory.cs +++ b/Migration.Toolkit.KX12/Models/CmsVersionHistory.cs @@ -1,117 +1,117 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServer.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServer.cs index a9810ea0..d6b6c126 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServer.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebFarmServer.cs @@ -1,34 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServerLog.cs index 351b1d98..60db41a3 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServerLog.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebFarmServerLog.cs @@ -1,23 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServerMonitoring.cs index bb441016..23ac32f2 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServerMonitoring.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebFarmServerMonitoring.cs @@ -1,20 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServerTask.cs index 315f5af2..b9006f57 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServerTask.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebFarmServerTask.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmTask.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmTask.cs index a4efb4d9..eb142c23 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmTask.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebFarmTask.cs @@ -1,42 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWebPart.cs b/Migration.Toolkit.KX12/Models/CmsWebPart.cs index b85aa7fd..ac733a47 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebPart.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebPart.cs @@ -1,86 +1,86 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWebPartCategory.cs b/Migration.Toolkit.KX12/Models/CmsWebPartCategory.cs index 64d8812d..0793cb55 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebPartCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebPartCategory.cs @@ -1,51 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWebPartContainer.cs b/Migration.Toolkit.KX12/Models/CmsWebPartContainer.cs index a51088f7..41f5de6b 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebPartContainer.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebPartContainer.cs @@ -1,38 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWebPartLayout.cs b/Migration.Toolkit.KX12/Models/CmsWebPartLayout.cs index 19b5866b..48fc5536 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebPartLayout.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebPartLayout.cs @@ -1,50 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWebTemplate.cs b/Migration.Toolkit.KX12/Models/CmsWebTemplate.cs index f30bc62d..a6cf8095 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebTemplate.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebTemplate.cs @@ -1,41 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWidget.cs b/Migration.Toolkit.KX12/Models/CmsWidget.cs index 18da074b..67794017 100644 --- a/Migration.Toolkit.KX12/Models/CmsWidget.cs +++ b/Migration.Toolkit.KX12/Models/CmsWidget.cs @@ -1,84 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWidgetCategory.cs b/Migration.Toolkit.KX12/Models/CmsWidgetCategory.cs index 7b944b17..e4d85d8c 100644 --- a/Migration.Toolkit.KX12/Models/CmsWidgetCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsWidgetCategory.cs @@ -1,51 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWidgetRole.cs b/Migration.Toolkit.KX12/Models/CmsWidgetRole.cs index 00e4ebcc..dc3c4666 100644 --- a/Migration.Toolkit.KX12/Models/CmsWidgetRole.cs +++ b/Migration.Toolkit.KX12/Models/CmsWidgetRole.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflow.cs b/Migration.Toolkit.KX12/Models/CmsWorkflow.cs index 536ea55c..927427f7 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflow.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflow.cs @@ -1,96 +1,96 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowAction.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowAction.cs index 8987998b..2a8dcb5f 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowAction.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowAction.cs @@ -1,66 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowHistory.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowHistory.cs index 343d3f98..90ac7d0c 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowHistory.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowHistory.cs @@ -1,88 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowScope.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowScope.cs index 0fb582fd..cb6ae3d8 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowScope.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowScope.cs @@ -1,60 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowStep.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowStep.cs index 905e9897..9e6b2261 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowStep.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowStep.cs @@ -1,115 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowStepRole.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowStepRole.cs index 945a3f23..269fe0d9 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowStepRole.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowStepRole.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowStepUser.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowStepUser.cs index 2bc453b2..b071c627 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowStepUser.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowStepUser.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowTransition.cs index 26c9711a..591f04c7 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowTransition.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowTransition.cs @@ -1,46 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComAddress.cs b/Migration.Toolkit.KX12/Models/ComAddress.cs index d4a3c68b..556a5dea 100644 --- a/Migration.Toolkit.KX12/Models/ComAddress.cs +++ b/Migration.Toolkit.KX12/Models/ComAddress.cs @@ -1,74 +1,74 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComBrand.cs b/Migration.Toolkit.KX12/Models/ComBrand.cs index 583ef8dc..0b5b7af6 100644 --- a/Migration.Toolkit.KX12/Models/ComBrand.cs +++ b/Migration.Toolkit.KX12/Models/ComBrand.cs @@ -1,51 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComCarrier.cs b/Migration.Toolkit.KX12/Models/ComCarrier.cs index 64807316..b7b83155 100644 --- a/Migration.Toolkit.KX12/Models/ComCarrier.cs +++ b/Migration.Toolkit.KX12/Models/ComCarrier.cs @@ -1,43 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComCollection.cs b/Migration.Toolkit.KX12/Models/ComCollection.cs index 0f6a2e6a..ac8a4e17 100644 --- a/Migration.Toolkit.KX12/Models/ComCollection.cs +++ b/Migration.Toolkit.KX12/Models/ComCollection.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.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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComCouponCode.cs b/Migration.Toolkit.KX12/Models/ComCouponCode.cs index 4bc1944e..438ffa7b 100644 --- a/Migration.Toolkit.KX12/Models/ComCouponCode.cs +++ b/Migration.Toolkit.KX12/Models/ComCouponCode.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComCurrency.cs b/Migration.Toolkit.KX12/Models/ComCurrency.cs index 7627c0cf..3a8b9c01 100644 --- a/Migration.Toolkit.KX12/Models/ComCurrency.cs +++ b/Migration.Toolkit.KX12/Models/ComCurrency.cs @@ -1,56 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComCurrencyExchangeRate.cs b/Migration.Toolkit.KX12/Models/ComCurrencyExchangeRate.cs index f99b87a8..e3e1ad17 100644 --- a/Migration.Toolkit.KX12/Models/ComCurrencyExchangeRate.cs +++ b/Migration.Toolkit.KX12/Models/ComCurrencyExchangeRate.cs @@ -1,39 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComCustomer.cs b/Migration.Toolkit.KX12/Models/ComCustomer.cs index cf54fd81..16971ff2 100644 --- a/Migration.Toolkit.KX12/Models/ComCustomer.cs +++ b/Migration.Toolkit.KX12/Models/ComCustomer.cs @@ -1,79 +1,79 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComCustomerCreditHistory.cs b/Migration.Toolkit.KX12/Models/ComCustomerCreditHistory.cs index b8b9b44a..830e8f45 100644 --- a/Migration.Toolkit.KX12/Models/ComCustomerCreditHistory.cs +++ b/Migration.Toolkit.KX12/Models/ComCustomerCreditHistory.cs @@ -1,46 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComDepartment.cs b/Migration.Toolkit.KX12/Models/ComDepartment.cs index 2603f544..9d2911d8 100644 --- a/Migration.Toolkit.KX12/Models/ComDepartment.cs +++ b/Migration.Toolkit.KX12/Models/ComDepartment.cs @@ -1,51 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComDiscount.cs b/Migration.Toolkit.KX12/Models/ComDiscount.cs index 192f9066..108d1347 100644 --- a/Migration.Toolkit.KX12/Models/ComDiscount.cs +++ b/Migration.Toolkit.KX12/Models/ComDiscount.cs @@ -1,74 +1,74 @@ -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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComExchangeTable.cs b/Migration.Toolkit.KX12/Models/ComExchangeTable.cs index 931e1806..4cf63e14 100644 --- a/Migration.Toolkit.KX12/Models/ComExchangeTable.cs +++ b/Migration.Toolkit.KX12/Models/ComExchangeTable.cs @@ -1,41 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComGiftCard.cs b/Migration.Toolkit.KX12/Models/ComGiftCard.cs index 7ab88dc7..d2f2115e 100644 --- a/Migration.Toolkit.KX12/Models/ComGiftCard.cs +++ b/Migration.Toolkit.KX12/Models/ComGiftCard.cs @@ -1,59 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComGiftCardCouponCode.cs b/Migration.Toolkit.KX12/Models/ComGiftCardCouponCode.cs index 35c17199..14c8708c 100644 --- a/Migration.Toolkit.KX12/Models/ComGiftCardCouponCode.cs +++ b/Migration.Toolkit.KX12/Models/ComGiftCardCouponCode.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComInternalStatus.cs b/Migration.Toolkit.KX12/Models/ComInternalStatus.cs index 8b7843ae..ffaa3797 100644 --- a/Migration.Toolkit.KX12/Models/ComInternalStatus.cs +++ b/Migration.Toolkit.KX12/Models/ComInternalStatus.cs @@ -1,40 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComManufacturer.cs b/Migration.Toolkit.KX12/Models/ComManufacturer.cs index 349f53b0..bf78c74a 100644 --- a/Migration.Toolkit.KX12/Models/ComManufacturer.cs +++ b/Migration.Toolkit.KX12/Models/ComManufacturer.cs @@ -1,48 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyCouponCode.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyCouponCode.cs index ef03be4f..745dc4f3 100644 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyCouponCode.cs +++ b/Migration.Toolkit.KX12/Models/ComMultiBuyCouponCode.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscount.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscount.cs index ac8d7acc..d9b19701 100644 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscount.cs +++ b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscount.cs @@ -1,98 +1,98 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountBrand.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountBrand.cs index 7801ae4b..62e7186f 100644 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountBrand.cs +++ b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountBrand.cs @@ -1,32 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountCollection.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountCollection.cs index d88a5df8..3b314b1f 100644 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountCollection.cs +++ b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountCollection.cs @@ -1,32 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountTree.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountTree.cs index 5379e673..c26a3a49 100644 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountTree.cs +++ b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountTree.cs @@ -1,32 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComOptionCategory.cs b/Migration.Toolkit.KX12/Models/ComOptionCategory.cs index f27551f8..8c44f940 100644 --- a/Migration.Toolkit.KX12/Models/ComOptionCategory.cs +++ b/Migration.Toolkit.KX12/Models/ComOptionCategory.cs @@ -1,66 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComOrder.cs b/Migration.Toolkit.KX12/Models/ComOrder.cs index 20d5b89c..4ab513cd 100644 --- a/Migration.Toolkit.KX12/Models/ComOrder.cs +++ b/Migration.Toolkit.KX12/Models/ComOrder.cs @@ -1,132 +1,132 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComOrderAddress.cs b/Migration.Toolkit.KX12/Models/ComOrderAddress.cs index 14e0d29e..47925767 100644 --- a/Migration.Toolkit.KX12/Models/ComOrderAddress.cs +++ b/Migration.Toolkit.KX12/Models/ComOrderAddress.cs @@ -1,64 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComOrderItem.cs b/Migration.Toolkit.KX12/Models/ComOrderItem.cs index 7c4af44f..cdf6e1ae 100644 --- a/Migration.Toolkit.KX12/Models/ComOrderItem.cs +++ b/Migration.Toolkit.KX12/Models/ComOrderItem.cs @@ -1,70 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComOrderItemSkufile.cs b/Migration.Toolkit.KX12/Models/ComOrderItemSkufile.cs index 73fe3955..78734f25 100644 --- a/Migration.Toolkit.KX12/Models/ComOrderItemSkufile.cs +++ b/Migration.Toolkit.KX12/Models/ComOrderItemSkufile.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComOrderStatus.cs b/Migration.Toolkit.KX12/Models/ComOrderStatus.cs index 4fe3183e..df9473bc 100644 --- a/Migration.Toolkit.KX12/Models/ComOrderStatus.cs +++ b/Migration.Toolkit.KX12/Models/ComOrderStatus.cs @@ -1,64 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComOrderStatusUser.cs b/Migration.Toolkit.KX12/Models/ComOrderStatusUser.cs index 4e70e79e..523016b4 100644 --- a/Migration.Toolkit.KX12/Models/ComOrderStatusUser.cs +++ b/Migration.Toolkit.KX12/Models/ComOrderStatusUser.cs @@ -1,51 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComPaymentOption.cs b/Migration.Toolkit.KX12/Models/ComPaymentOption.cs index 485e6196..b6b4b868 100644 --- a/Migration.Toolkit.KX12/Models/ComPaymentOption.cs +++ b/Migration.Toolkit.KX12/Models/ComPaymentOption.cs @@ -1,83 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComPublicStatus.cs b/Migration.Toolkit.KX12/Models/ComPublicStatus.cs index e5394d05..7ca61205 100644 --- a/Migration.Toolkit.KX12/Models/ComPublicStatus.cs +++ b/Migration.Toolkit.KX12/Models/ComPublicStatus.cs @@ -1,40 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComShippingCost.cs b/Migration.Toolkit.KX12/Models/ComShippingCost.cs index aa277bcd..12152a09 100644 --- a/Migration.Toolkit.KX12/Models/ComShippingCost.cs +++ b/Migration.Toolkit.KX12/Models/ComShippingCost.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComShippingOption.cs b/Migration.Toolkit.KX12/Models/ComShippingOption.cs index 5a839c16..5bd5ef31 100644 --- a/Migration.Toolkit.KX12/Models/ComShippingOption.cs +++ b/Migration.Toolkit.KX12/Models/ComShippingOption.cs @@ -1,70 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComShoppingCart.cs b/Migration.Toolkit.KX12/Models/ComShoppingCart.cs index 1c97d5ee..4c733227 100644 --- a/Migration.Toolkit.KX12/Models/ComShoppingCart.cs +++ b/Migration.Toolkit.KX12/Models/ComShoppingCart.cs @@ -1,107 +1,107 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComShoppingCartCouponCode.cs b/Migration.Toolkit.KX12/Models/ComShoppingCartCouponCode.cs index 7841ebf2..8267282f 100644 --- a/Migration.Toolkit.KX12/Models/ComShoppingCartCouponCode.cs +++ b/Migration.Toolkit.KX12/Models/ComShoppingCartCouponCode.cs @@ -1,26 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComShoppingCartSku.cs b/Migration.Toolkit.KX12/Models/ComShoppingCartSku.cs index 6c4e375c..ee21968e 100644 --- a/Migration.Toolkit.KX12/Models/ComShoppingCartSku.cs +++ b/Migration.Toolkit.KX12/Models/ComShoppingCartSku.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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComSku.cs b/Migration.Toolkit.KX12/Models/ComSku.cs index 25097254..4a01fc39 100644 --- a/Migration.Toolkit.KX12/Models/ComSku.cs +++ b/Migration.Toolkit.KX12/Models/ComSku.cs @@ -1,278 +1,278 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComSkufile.cs b/Migration.Toolkit.KX12/Models/ComSkufile.cs index dee08f04..1b75c82c 100644 --- a/Migration.Toolkit.KX12/Models/ComSkufile.cs +++ b/Migration.Toolkit.KX12/Models/ComSkufile.cs @@ -1,43 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComSkuoptionCategory.cs b/Migration.Toolkit.KX12/Models/ComSkuoptionCategory.cs index 344344d3..30ca56af 100644 --- a/Migration.Toolkit.KX12/Models/ComSkuoptionCategory.cs +++ b/Migration.Toolkit.KX12/Models/ComSkuoptionCategory.cs @@ -1,36 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComSupplier.cs b/Migration.Toolkit.KX12/Models/ComSupplier.cs index a8bdb448..b07c367e 100644 --- a/Migration.Toolkit.KX12/Models/ComSupplier.cs +++ b/Migration.Toolkit.KX12/Models/ComSupplier.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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComTaxClass.cs b/Migration.Toolkit.KX12/Models/ComTaxClass.cs index 82ce0035..f62d540a 100644 --- a/Migration.Toolkit.KX12/Models/ComTaxClass.cs +++ b/Migration.Toolkit.KX12/Models/ComTaxClass.cs @@ -1,52 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComTaxClassCountry.cs b/Migration.Toolkit.KX12/Models/ComTaxClassCountry.cs index f567202e..fe7a869a 100644 --- a/Migration.Toolkit.KX12/Models/ComTaxClassCountry.cs +++ b/Migration.Toolkit.KX12/Models/ComTaxClassCountry.cs @@ -1,34 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComTaxClassState.cs b/Migration.Toolkit.KX12/Models/ComTaxClassState.cs index c8a6a413..2026489e 100644 --- a/Migration.Toolkit.KX12/Models/ComTaxClassState.cs +++ b/Migration.Toolkit.KX12/Models/ComTaxClassState.cs @@ -1,34 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComVolumeDiscount.cs b/Migration.Toolkit.KX12/Models/ComVolumeDiscount.cs index b6934cd0..dd120646 100644 --- a/Migration.Toolkit.KX12/Models/ComVolumeDiscount.cs +++ b/Migration.Toolkit.KX12/Models/ComVolumeDiscount.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ComWishlist.cs b/Migration.Toolkit.KX12/Models/ComWishlist.cs index 4523c804..8c061814 100644 --- a/Migration.Toolkit.KX12/Models/ComWishlist.cs +++ b/Migration.Toolkit.KX12/Models/ComWishlist.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CommunityGroup.cs b/Migration.Toolkit.KX12/Models/CommunityGroup.cs index 96b210e9..5ced4c3d 100644 --- a/Migration.Toolkit.KX12/Models/CommunityGroup.cs +++ b/Migration.Toolkit.KX12/Models/CommunityGroup.cs @@ -1,110 +1,110 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/CommunityGroupMember.cs b/Migration.Toolkit.KX12/Models/CommunityGroupMember.cs index 9a5725c0..14faa9c9 100644 --- a/Migration.Toolkit.KX12/Models/CommunityGroupMember.cs +++ b/Migration.Toolkit.KX12/Models/CommunityGroupMember.cs @@ -1,61 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CommunityGroupRolePermission.cs b/Migration.Toolkit.KX12/Models/CommunityGroupRolePermission.cs index 09a085fe..fd1f7079 100644 --- a/Migration.Toolkit.KX12/Models/CommunityGroupRolePermission.cs +++ b/Migration.Toolkit.KX12/Models/CommunityGroupRolePermission.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/CommunityInvitation.cs b/Migration.Toolkit.KX12/Models/CommunityInvitation.cs index c38737dc..f346b369 100644 --- a/Migration.Toolkit.KX12/Models/CommunityInvitation.cs +++ b/Migration.Toolkit.KX12/Models/CommunityInvitation.cs @@ -1,53 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ContentFile.cs b/Migration.Toolkit.KX12/Models/ContentFile.cs index 68c4bf86..d5cd26f2 100644 --- a/Migration.Toolkit.KX12/Models/ContentFile.cs +++ b/Migration.Toolkit.KX12/Models/ContentFile.cs @@ -1,23 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/EventsAttendee.cs b/Migration.Toolkit.KX12/Models/EventsAttendee.cs index 669bf92c..50b60148 100644 --- a/Migration.Toolkit.KX12/Models/EventsAttendee.cs +++ b/Migration.Toolkit.KX12/Models/EventsAttendee.cs @@ -1,40 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ExportHistory.cs b/Migration.Toolkit.KX12/Models/ExportHistory.cs index 87876785..5e0a6236 100644 --- a/Migration.Toolkit.KX12/Models/ExportHistory.cs +++ b/Migration.Toolkit.KX12/Models/ExportHistory.cs @@ -1,38 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ExportTask.cs b/Migration.Toolkit.KX12/Models/ExportTask.cs index 4da7131b..c3aa7b02 100644 --- a/Migration.Toolkit.KX12/Models/ExportTask.cs +++ b/Migration.Toolkit.KX12/Models/ExportTask.cs @@ -1,39 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ForumsAttachment.cs b/Migration.Toolkit.KX12/Models/ForumsAttachment.cs index 5a2256aa..6e652a65 100644 --- a/Migration.Toolkit.KX12/Models/ForumsAttachment.cs +++ b/Migration.Toolkit.KX12/Models/ForumsAttachment.cs @@ -1,53 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ForumsForum.cs b/Migration.Toolkit.KX12/Models/ForumsForum.cs index f57ac093..badd3bea 100644 --- a/Migration.Toolkit.KX12/Models/ForumsForum.cs +++ b/Migration.Toolkit.KX12/Models/ForumsForum.cs @@ -1,147 +1,147 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ForumsForumGroup.cs b/Migration.Toolkit.KX12/Models/ForumsForumGroup.cs index affcdc15..e4c95dd7 100644 --- a/Migration.Toolkit.KX12/Models/ForumsForumGroup.cs +++ b/Migration.Toolkit.KX12/Models/ForumsForumGroup.cs @@ -1,89 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ForumsForumPost.cs b/Migration.Toolkit.KX12/Models/ForumsForumPost.cs index df33411c..f4d8ad5e 100644 --- a/Migration.Toolkit.KX12/Models/ForumsForumPost.cs +++ b/Migration.Toolkit.KX12/Models/ForumsForumPost.cs @@ -1,124 +1,124 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ForumsForumRole.cs b/Migration.Toolkit.KX12/Models/ForumsForumRole.cs index 47354307..a7cf931e 100644 --- a/Migration.Toolkit.KX12/Models/ForumsForumRole.cs +++ b/Migration.Toolkit.KX12/Models/ForumsForumRole.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ForumsForumSubscription.cs b/Migration.Toolkit.KX12/Models/ForumsForumSubscription.cs index c298845f..64d766da 100644 --- a/Migration.Toolkit.KX12/Models/ForumsForumSubscription.cs +++ b/Migration.Toolkit.KX12/Models/ForumsForumSubscription.cs @@ -1,52 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ForumsUserFavorite.cs b/Migration.Toolkit.KX12/Models/ForumsUserFavorite.cs index 8a6bb351..45101ba1 100644 --- a/Migration.Toolkit.KX12/Models/ForumsUserFavorite.cs +++ b/Migration.Toolkit.KX12/Models/ForumsUserFavorite.cs @@ -1,56 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/IntegrationConnector.cs b/Migration.Toolkit.KX12/Models/IntegrationConnector.cs index 0d37d0cc..0f3ed25d 100644 --- a/Migration.Toolkit.KX12/Models/IntegrationConnector.cs +++ b/Migration.Toolkit.KX12/Models/IntegrationConnector.cs @@ -1,36 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/IntegrationSyncLog.cs b/Migration.Toolkit.KX12/Models/IntegrationSyncLog.cs index e09acb94..96e6d8ff 100644 --- a/Migration.Toolkit.KX12/Models/IntegrationSyncLog.cs +++ b/Migration.Toolkit.KX12/Models/IntegrationSyncLog.cs @@ -1,27 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/IntegrationSynchronization.cs b/Migration.Toolkit.KX12/Models/IntegrationSynchronization.cs index e18848d9..0e7828b5 100644 --- a/Migration.Toolkit.KX12/Models/IntegrationSynchronization.cs +++ b/Migration.Toolkit.KX12/Models/IntegrationSynchronization.cs @@ -1,40 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/IntegrationTask.cs b/Migration.Toolkit.KX12/Models/IntegrationTask.cs index 4e3368c4..01c2f047 100644 --- a/Migration.Toolkit.KX12/Models/IntegrationTask.cs +++ b/Migration.Toolkit.KX12/Models/IntegrationTask.cs @@ -1,60 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/MediaFile.cs b/Migration.Toolkit.KX12/Models/MediaFile.cs index dbefc824..a97d0fca 100644 --- a/Migration.Toolkit.KX12/Models/MediaFile.cs +++ b/Migration.Toolkit.KX12/Models/MediaFile.cs @@ -1,78 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/MediaLibrary.cs b/Migration.Toolkit.KX12/Models/MediaLibrary.cs index 61737037..e22d9b13 100644 --- a/Migration.Toolkit.KX12/Models/MediaLibrary.cs +++ b/Migration.Toolkit.KX12/Models/MediaLibrary.cs @@ -1,61 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/MediaLibraryRolePermission.cs b/Migration.Toolkit.KX12/Models/MediaLibraryRolePermission.cs index c5f068f6..139aed60 100644 --- a/Migration.Toolkit.KX12/Models/MediaLibraryRolePermission.cs +++ b/Migration.Toolkit.KX12/Models/MediaLibraryRolePermission.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterAbtest.cs b/Migration.Toolkit.KX12/Models/NewsletterAbtest.cs index a079e620..d22ea57d 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterAbtest.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterAbtest.cs @@ -1,54 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterClickedLink.cs b/Migration.Toolkit.KX12/Models/NewsletterClickedLink.cs index 3a7fe905..31cb9fc0 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterClickedLink.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterClickedLink.cs @@ -1,30 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmail.cs b/Migration.Toolkit.KX12/Models/NewsletterEmail.cs index 102ee0ed..4fba7ba5 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterEmail.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterEmail.cs @@ -1,56 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmailTemplate.cs b/Migration.Toolkit.KX12/Models/NewsletterEmailTemplate.cs index 7d15a906..fc7ac7cc 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterEmailTemplate.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterEmailTemplate.cs @@ -1,69 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmailWidget.cs b/Migration.Toolkit.KX12/Models/NewsletterEmailWidget.cs index bf2b393b..de07f81a 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterEmailWidget.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterEmailWidget.cs @@ -1,48 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Toolkit.KX12/Models/NewsletterEmailWidgetTemplate.cs index 3f09754b..36dc4765 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterEmailWidgetTemplate.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterEmailWidgetTemplate.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterIssueContactGroup.cs b/Migration.Toolkit.KX12/Models/NewsletterIssueContactGroup.cs index a8e2c42c..f0f08904 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterIssueContactGroup.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterIssueContactGroup.cs @@ -1,26 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterLink.cs b/Migration.Toolkit.KX12/Models/NewsletterLink.cs index 54301123..6533d1bc 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterLink.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterLink.cs @@ -1,34 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterNewsletter.cs b/Migration.Toolkit.KX12/Models/NewsletterNewsletter.cs index 982f3b46..39afeafd 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterNewsletter.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterNewsletter.cs @@ -1,116 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterNewsletterIssue.cs b/Migration.Toolkit.KX12/Models/NewsletterNewsletterIssue.cs index 9784bd89..8b2ed491 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterNewsletterIssue.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterNewsletterIssue.cs @@ -1,126 +1,126 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterOpenedEmail.cs b/Migration.Toolkit.KX12/Models/NewsletterOpenedEmail.cs index 186508b5..330e0f3f 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterOpenedEmail.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterOpenedEmail.cs @@ -1,30 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterSubscriber.cs b/Migration.Toolkit.KX12/Models/NewsletterSubscriber.cs index 33624a8f..85024aed 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterSubscriber.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterSubscriber.cs @@ -1,57 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterSubscriberNewsletter.cs b/Migration.Toolkit.KX12/Models/NewsletterSubscriberNewsletter.cs index 84c20f05..bf2ead71 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterSubscriberNewsletter.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterSubscriberNewsletter.cs @@ -1,40 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/NewsletterUnsubscription.cs b/Migration.Toolkit.KX12/Models/NewsletterUnsubscription.cs index 958165a5..136a523d 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterUnsubscription.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterUnsubscription.cs @@ -1,40 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/NotificationGateway.cs b/Migration.Toolkit.KX12/Models/NotificationGateway.cs index e8e8530e..79d12b62 100644 --- a/Migration.Toolkit.KX12/Models/NotificationGateway.cs +++ b/Migration.Toolkit.KX12/Models/NotificationGateway.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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/NotificationSubscription.cs b/Migration.Toolkit.KX12/Models/NotificationSubscription.cs index f329b5e4..7d482033 100644 --- a/Migration.Toolkit.KX12/Models/NotificationSubscription.cs +++ b/Migration.Toolkit.KX12/Models/NotificationSubscription.cs @@ -1,77 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/NotificationTemplate.cs b/Migration.Toolkit.KX12/Models/NotificationTemplate.cs index 3d526802..675efac8 100644 --- a/Migration.Toolkit.KX12/Models/NotificationTemplate.cs +++ b/Migration.Toolkit.KX12/Models/NotificationTemplate.cs @@ -1,40 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/NotificationTemplateText.cs b/Migration.Toolkit.KX12/Models/NotificationTemplateText.cs index 557ce13d..e592397d 100644 --- a/Migration.Toolkit.KX12/Models/NotificationTemplateText.cs +++ b/Migration.Toolkit.KX12/Models/NotificationTemplateText.cs @@ -1,44 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmAbtest.cs b/Migration.Toolkit.KX12/Models/OmAbtest.cs index d86a44e5..e86410b8 100644 --- a/Migration.Toolkit.KX12/Models/OmAbtest.cs +++ b/Migration.Toolkit.KX12/Models/OmAbtest.cs @@ -1,72 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmAbvariant.cs b/Migration.Toolkit.KX12/Models/OmAbvariant.cs index 4b8df6ce..91207159 100644 --- a/Migration.Toolkit.KX12/Models/OmAbvariant.cs +++ b/Migration.Toolkit.KX12/Models/OmAbvariant.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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmAbvariantDatum.cs b/Migration.Toolkit.KX12/Models/OmAbvariantDatum.cs index 3b81d91e..f085164d 100644 --- a/Migration.Toolkit.KX12/Models/OmAbvariantDatum.cs +++ b/Migration.Toolkit.KX12/Models/OmAbvariantDatum.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmAccount.cs b/Migration.Toolkit.KX12/Models/OmAccount.cs index 46fec60f..128ac1b8 100644 --- a/Migration.Toolkit.KX12/Models/OmAccount.cs +++ b/Migration.Toolkit.KX12/Models/OmAccount.cs @@ -1,114 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmAccountContact.cs b/Migration.Toolkit.KX12/Models/OmAccountContact.cs index b3c1f620..9327c274 100644 --- a/Migration.Toolkit.KX12/Models/OmAccountContact.cs +++ b/Migration.Toolkit.KX12/Models/OmAccountContact.cs @@ -1,39 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmAccountStatus.cs b/Migration.Toolkit.KX12/Models/OmAccountStatus.cs index 91132de9..d3487abe 100644 --- a/Migration.Toolkit.KX12/Models/OmAccountStatus.cs +++ b/Migration.Toolkit.KX12/Models/OmAccountStatus.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmActivity.cs b/Migration.Toolkit.KX12/Models/OmActivity.cs index 2da4ec31..036c33a9 100644 --- a/Migration.Toolkit.KX12/Models/OmActivity.cs +++ b/Migration.Toolkit.KX12/Models/OmActivity.cs @@ -1,79 +1,79 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.KX12/Models/OmActivityRecalculationQueue.cs index aafd7a7b..691d7f26 100644 --- a/Migration.Toolkit.KX12/Models/OmActivityRecalculationQueue.cs +++ b/Migration.Toolkit.KX12/Models/OmActivityRecalculationQueue.cs @@ -1,18 +1,18 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmActivityType.cs b/Migration.Toolkit.KX12/Models/OmActivityType.cs index 8380a781..21beb153 100644 --- a/Migration.Toolkit.KX12/Models/OmActivityType.cs +++ b/Migration.Toolkit.KX12/Models/OmActivityType.cs @@ -1,40 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmContact.cs b/Migration.Toolkit.KX12/Models/OmContact.cs index 63d4de0b..5e3973a9 100644 --- a/Migration.Toolkit.KX12/Models/OmContact.cs +++ b/Migration.Toolkit.KX12/Models/OmContact.cs @@ -1,141 +1,141 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.KX12/Models/OmContactChangeRecalculationQueue.cs index 62aa0381..a3e5f9bc 100644 --- a/Migration.Toolkit.KX12/Models/OmContactChangeRecalculationQueue.cs +++ b/Migration.Toolkit.KX12/Models/OmContactChangeRecalculationQueue.cs @@ -1,24 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmContactGroup.cs b/Migration.Toolkit.KX12/Models/OmContactGroup.cs index 6a53c444..665f9dd6 100644 --- a/Migration.Toolkit.KX12/Models/OmContactGroup.cs +++ b/Migration.Toolkit.KX12/Models/OmContactGroup.cs @@ -1,40 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmContactGroupMember.cs b/Migration.Toolkit.KX12/Models/OmContactGroupMember.cs index 13ac461d..625e3468 100644 --- a/Migration.Toolkit.KX12/Models/OmContactGroupMember.cs +++ b/Migration.Toolkit.KX12/Models/OmContactGroupMember.cs @@ -1,36 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmContactRole.cs b/Migration.Toolkit.KX12/Models/OmContactRole.cs index 5ed2bc5f..3cf30f61 100644 --- a/Migration.Toolkit.KX12/Models/OmContactRole.cs +++ b/Migration.Toolkit.KX12/Models/OmContactRole.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmContactStatus.cs b/Migration.Toolkit.KX12/Models/OmContactStatus.cs index 7ac2e116..af7cb884 100644 --- a/Migration.Toolkit.KX12/Models/OmContactStatus.cs +++ b/Migration.Toolkit.KX12/Models/OmContactStatus.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmMembership.cs b/Migration.Toolkit.KX12/Models/OmMembership.cs index 958380bd..66361156 100644 --- a/Migration.Toolkit.KX12/Models/OmMembership.cs +++ b/Migration.Toolkit.KX12/Models/OmMembership.cs @@ -1,34 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmMvtcombination.cs b/Migration.Toolkit.KX12/Models/OmMvtcombination.cs index 43c9007f..8972e017 100644 --- a/Migration.Toolkit.KX12/Models/OmMvtcombination.cs +++ b/Migration.Toolkit.KX12/Models/OmMvtcombination.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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmMvtest.cs b/Migration.Toolkit.KX12/Models/OmMvtest.cs index 5e377c0e..c5d73e97 100644 --- a/Migration.Toolkit.KX12/Models/OmMvtest.cs +++ b/Migration.Toolkit.KX12/Models/OmMvtest.cs @@ -1,67 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmMvtvariant.cs b/Migration.Toolkit.KX12/Models/OmMvtvariant.cs index 2e79aedd..35b7f868 100644 --- a/Migration.Toolkit.KX12/Models/OmMvtvariant.cs +++ b/Migration.Toolkit.KX12/Models/OmMvtvariant.cs @@ -1,61 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmPersonalizationVariant.cs b/Migration.Toolkit.KX12/Models/OmPersonalizationVariant.cs index bd6147ba..af3d08e8 100644 --- a/Migration.Toolkit.KX12/Models/OmPersonalizationVariant.cs +++ b/Migration.Toolkit.KX12/Models/OmPersonalizationVariant.cs @@ -1,60 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmRule.cs b/Migration.Toolkit.KX12/Models/OmRule.cs index 3f8c5298..3eddffad 100644 --- a/Migration.Toolkit.KX12/Models/OmRule.cs +++ b/Migration.Toolkit.KX12/Models/OmRule.cs @@ -1,59 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmScore.cs b/Migration.Toolkit.KX12/Models/OmScore.cs index 1e3c38a4..515c46c7 100644 --- a/Migration.Toolkit.KX12/Models/OmScore.cs +++ b/Migration.Toolkit.KX12/Models/OmScore.cs @@ -1,48 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmScoreContactRule.cs b/Migration.Toolkit.KX12/Models/OmScoreContactRule.cs index 3395d9b7..bbc72aa5 100644 --- a/Migration.Toolkit.KX12/Models/OmScoreContactRule.cs +++ b/Migration.Toolkit.KX12/Models/OmScoreContactRule.cs @@ -1,44 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/OmVisitorToContact.cs b/Migration.Toolkit.KX12/Models/OmVisitorToContact.cs index 57c5a0f1..897846a6 100644 --- a/Migration.Toolkit.KX12/Models/OmVisitorToContact.cs +++ b/Migration.Toolkit.KX12/Models/OmVisitorToContact.cs @@ -1,27 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/PersonasPersona.cs b/Migration.Toolkit.KX12/Models/PersonasPersona.cs index 8e3f4fcb..8ea4fb86 100644 --- a/Migration.Toolkit.KX12/Models/PersonasPersona.cs +++ b/Migration.Toolkit.KX12/Models/PersonasPersona.cs @@ -1,41 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/PersonasPersonaContactHistory.cs b/Migration.Toolkit.KX12/Models/PersonasPersonaContactHistory.cs index d307fd1c..8860cf4b 100644 --- a/Migration.Toolkit.KX12/Models/PersonasPersonaContactHistory.cs +++ b/Migration.Toolkit.KX12/Models/PersonasPersonaContactHistory.cs @@ -1,28 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/PersonasPersonaNode.cs b/Migration.Toolkit.KX12/Models/PersonasPersonaNode.cs index ffb97008..438e9d92 100644 --- a/Migration.Toolkit.KX12/Models/PersonasPersonaNode.cs +++ b/Migration.Toolkit.KX12/Models/PersonasPersonaNode.cs @@ -1,26 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/PollsPoll.cs b/Migration.Toolkit.KX12/Models/PollsPoll.cs index 0228c4e7..63ddea6c 100644 --- a/Migration.Toolkit.KX12/Models/PollsPoll.cs +++ b/Migration.Toolkit.KX12/Models/PollsPoll.cs @@ -1,72 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/PollsPollAnswer.cs b/Migration.Toolkit.KX12/Models/PollsPollAnswer.cs index fd1fd54a..04b4a777 100644 --- a/Migration.Toolkit.KX12/Models/PollsPollAnswer.cs +++ b/Migration.Toolkit.KX12/Models/PollsPollAnswer.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.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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ReportingReport.cs b/Migration.Toolkit.KX12/Models/ReportingReport.cs index 8a0f396d..541c35d2 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReport.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReport.cs @@ -1,62 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ReportingReportCategory.cs b/Migration.Toolkit.KX12/Models/ReportingReportCategory.cs index cfc808de..4a91c52a 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReportCategory.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReportCategory.cs @@ -1,51 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ReportingReportGraph.cs b/Migration.Toolkit.KX12/Models/ReportingReportGraph.cs index 8e8f5e9a..2e693e7f 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReportGraph.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReportGraph.cs @@ -1,69 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/ReportingReportSubscription.cs b/Migration.Toolkit.KX12/Models/ReportingReportSubscription.cs index 24b2c73a..5a470e73 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReportSubscription.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReportSubscription.cs @@ -1,93 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ReportingReportTable.cs b/Migration.Toolkit.KX12/Models/ReportingReportTable.cs index 3294b482..b61d553c 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReportTable.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReportTable.cs @@ -1,47 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ReportingReportValue.cs b/Migration.Toolkit.KX12/Models/ReportingReportValue.cs index 7901f61e..cdf884c6 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReportValue.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReportValue.cs @@ -1,50 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ReportingSavedGraph.cs b/Migration.Toolkit.KX12/Models/ReportingSavedGraph.cs index 7711e28f..3074a69f 100644 --- a/Migration.Toolkit.KX12/Models/ReportingSavedGraph.cs +++ b/Migration.Toolkit.KX12/Models/ReportingSavedGraph.cs @@ -1,34 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ReportingSavedReport.cs b/Migration.Toolkit.KX12/Models/ReportingSavedReport.cs index 3bab9f4c..2bfeccb9 100644 --- a/Migration.Toolkit.KX12/Models/ReportingSavedReport.cs +++ b/Migration.Toolkit.KX12/Models/ReportingSavedReport.cs @@ -1,48 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/SharePointSharePointConnection.cs b/Migration.Toolkit.KX12/Models/SharePointSharePointConnection.cs index 133884c7..fb7a7cce 100644 --- a/Migration.Toolkit.KX12/Models/SharePointSharePointConnection.cs +++ b/Migration.Toolkit.KX12/Models/SharePointSharePointConnection.cs @@ -1,55 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/SharePointSharePointFile.cs b/Migration.Toolkit.KX12/Models/SharePointSharePointFile.cs index f7d6ac28..f0eb8fc5 100644 --- a/Migration.Toolkit.KX12/Models/SharePointSharePointFile.cs +++ b/Migration.Toolkit.KX12/Models/SharePointSharePointFile.cs @@ -1,57 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/SharePointSharePointLibrary.cs b/Migration.Toolkit.KX12/Models/SharePointSharePointLibrary.cs index 8e1a7ea9..90bcd8af 100644 --- a/Migration.Toolkit.KX12/Models/SharePointSharePointLibrary.cs +++ b/Migration.Toolkit.KX12/Models/SharePointSharePointLibrary.cs @@ -1,52 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmFacebookAccount.cs b/Migration.Toolkit.KX12/Models/SmFacebookAccount.cs index 33f97cf0..e310ebdf 100644 --- a/Migration.Toolkit.KX12/Models/SmFacebookAccount.cs +++ b/Migration.Toolkit.KX12/Models/SmFacebookAccount.cs @@ -1,55 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmFacebookApplication.cs b/Migration.Toolkit.KX12/Models/SmFacebookApplication.cs index 647655d6..2e234d08 100644 --- a/Migration.Toolkit.KX12/Models/SmFacebookApplication.cs +++ b/Migration.Toolkit.KX12/Models/SmFacebookApplication.cs @@ -1,43 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmFacebookPost.cs b/Migration.Toolkit.KX12/Models/SmFacebookPost.cs index ad8659df..420ae9a2 100644 --- a/Migration.Toolkit.KX12/Models/SmFacebookPost.cs +++ b/Migration.Toolkit.KX12/Models/SmFacebookPost.cs @@ -1,89 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmInsight.cs b/Migration.Toolkit.KX12/Models/SmInsight.cs index 8d8a4c71..19962c0f 100644 --- a/Migration.Toolkit.KX12/Models/SmInsight.cs +++ b/Migration.Toolkit.KX12/Models/SmInsight.cs @@ -1,39 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitDay.cs b/Migration.Toolkit.KX12/Models/SmInsightHitDay.cs index 04a5ad23..00c6e9ec 100644 --- a/Migration.Toolkit.KX12/Models/SmInsightHitDay.cs +++ b/Migration.Toolkit.KX12/Models/SmInsightHitDay.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitMonth.cs b/Migration.Toolkit.KX12/Models/SmInsightHitMonth.cs index 5ed443aa..f584a3d8 100644 --- a/Migration.Toolkit.KX12/Models/SmInsightHitMonth.cs +++ b/Migration.Toolkit.KX12/Models/SmInsightHitMonth.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitWeek.cs b/Migration.Toolkit.KX12/Models/SmInsightHitWeek.cs index ade16f57..54cd9e78 100644 --- a/Migration.Toolkit.KX12/Models/SmInsightHitWeek.cs +++ b/Migration.Toolkit.KX12/Models/SmInsightHitWeek.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitYear.cs b/Migration.Toolkit.KX12/Models/SmInsightHitYear.cs index b2adecdb..43355108 100644 --- a/Migration.Toolkit.KX12/Models/SmInsightHitYear.cs +++ b/Migration.Toolkit.KX12/Models/SmInsightHitYear.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmLinkedInAccount.cs b/Migration.Toolkit.KX12/Models/SmLinkedInAccount.cs index 3d66cb99..f922dac6 100644 --- a/Migration.Toolkit.KX12/Models/SmLinkedInAccount.cs +++ b/Migration.Toolkit.KX12/Models/SmLinkedInAccount.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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmLinkedInApplication.cs b/Migration.Toolkit.KX12/Models/SmLinkedInApplication.cs index 21bf2efa..e8af2885 100644 --- a/Migration.Toolkit.KX12/Models/SmLinkedInApplication.cs +++ b/Migration.Toolkit.KX12/Models/SmLinkedInApplication.cs @@ -1,40 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmLinkedInPost.cs b/Migration.Toolkit.KX12/Models/SmLinkedInPost.cs index cfe6ca7c..1305284d 100644 --- a/Migration.Toolkit.KX12/Models/SmLinkedInPost.cs +++ b/Migration.Toolkit.KX12/Models/SmLinkedInPost.cs @@ -1,85 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmTwitterAccount.cs b/Migration.Toolkit.KX12/Models/SmTwitterAccount.cs index 29ff9c63..3a0f776a 100644 --- a/Migration.Toolkit.KX12/Models/SmTwitterAccount.cs +++ b/Migration.Toolkit.KX12/Models/SmTwitterAccount.cs @@ -1,64 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmTwitterApplication.cs b/Migration.Toolkit.KX12/Models/SmTwitterApplication.cs index d0b4ce4e..17cd8566 100644 --- a/Migration.Toolkit.KX12/Models/SmTwitterApplication.cs +++ b/Migration.Toolkit.KX12/Models/SmTwitterApplication.cs @@ -1,43 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/SmTwitterPost.cs b/Migration.Toolkit.KX12/Models/SmTwitterPost.cs index bcbf6395..619f984a 100644 --- a/Migration.Toolkit.KX12/Models/SmTwitterPost.cs +++ b/Migration.Toolkit.KX12/Models/SmTwitterPost.cs @@ -1,71 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/StagingServer.cs b/Migration.Toolkit.KX12/Models/StagingServer.cs index fbbd390c..11f1131c 100644 --- a/Migration.Toolkit.KX12/Models/StagingServer.cs +++ b/Migration.Toolkit.KX12/Models/StagingServer.cs @@ -1,62 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/StagingSynchronization.cs b/Migration.Toolkit.KX12/Models/StagingSynchronization.cs index 9408869f..2ae2c62c 100644 --- a/Migration.Toolkit.KX12/Models/StagingSynchronization.cs +++ b/Migration.Toolkit.KX12/Models/StagingSynchronization.cs @@ -1,35 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/StagingTask.cs b/Migration.Toolkit.KX12/Models/StagingTask.cs index bdd77b2f..6dd40a94 100644 --- a/Migration.Toolkit.KX12/Models/StagingTask.cs +++ b/Migration.Toolkit.KX12/Models/StagingTask.cs @@ -1,64 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/StagingTaskGroup.cs b/Migration.Toolkit.KX12/Models/StagingTaskGroup.cs index 1b892908..78e19ae1 100644 --- a/Migration.Toolkit.KX12/Models/StagingTaskGroup.cs +++ b/Migration.Toolkit.KX12/Models/StagingTaskGroup.cs @@ -1,28 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX12/Models/StagingTaskGroupTask.cs b/Migration.Toolkit.KX12/Models/StagingTaskGroupTask.cs index 01ef2b52..07a0feb5 100644 --- a/Migration.Toolkit.KX12/Models/StagingTaskGroupTask.cs +++ b/Migration.Toolkit.KX12/Models/StagingTaskGroupTask.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/StagingTaskGroupUser.cs b/Migration.Toolkit.KX12/Models/StagingTaskGroupUser.cs index 34d345f2..d1e56def 100644 --- a/Migration.Toolkit.KX12/Models/StagingTaskGroupUser.cs +++ b/Migration.Toolkit.KX12/Models/StagingTaskGroupUser.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/StagingTaskUser.cs b/Migration.Toolkit.KX12/Models/StagingTaskUser.cs index d0f3a42a..42a7df04 100644 --- a/Migration.Toolkit.KX12/Models/StagingTaskUser.cs +++ b/Migration.Toolkit.KX12/Models/StagingTaskUser.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/TempFile.cs b/Migration.Toolkit.KX12/Models/TempFile.cs index d6092558..73fa95aa 100644 --- a/Migration.Toolkit.KX12/Models/TempFile.cs +++ b/Migration.Toolkit.KX12/Models/TempFile.cs @@ -1,50 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/TempPageBuilderWidget.cs b/Migration.Toolkit.KX12/Models/TempPageBuilderWidget.cs index f1ef79ea..84c8b631 100644 --- a/Migration.Toolkit.KX12/Models/TempPageBuilderWidget.cs +++ b/Migration.Toolkit.KX12/Models/TempPageBuilderWidget.cs @@ -1,23 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewBoardsBoardMessageJoined.cs b/Migration.Toolkit.KX12/Models/ViewBoardsBoardMessageJoined.cs index cae06661..cf031f70 100644 --- a/Migration.Toolkit.KX12/Models/ViewBoardsBoardMessageJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewBoardsBoardMessageJoined.cs @@ -1,159 +1,159 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Toolkit.KX12/Models/ViewCmsAclitemItemsAndOperator.cs index 5cb30f6f..cd8bb71e 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsAclitemItemsAndOperator.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsAclitemItemsAndOperator.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.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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs index c80e2627..b2142646 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs @@ -1,124 +1,124 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs index a839d0ef..3c96bffe 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs @@ -1,58 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsRelationshipJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsRelationshipJoined.cs index e1d01eca..c1c7b027 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsRelationshipJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsRelationshipJoined.cs @@ -1,51 +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 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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsResourceStringJoined.cs index 33df0623..7a027bee 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsResourceStringJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsResourceStringJoined.cs @@ -1,44 +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 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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsResourceTranslatedJoined.cs index c4b02b97..7c3d7ad3 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsResourceTranslatedJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsResourceTranslatedJoined.cs @@ -1,28 +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 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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs index e51f3ba1..9ccffe05 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs @@ -1,23 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsSiteDocumentCount.cs b/Migration.Toolkit.KX12/Models/ViewCmsSiteDocumentCount.cs index 6ea7c389..d87e4399 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsSiteDocumentCount.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsSiteDocumentCount.cs @@ -1,47 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs index a52f7ebd..482d3dc8 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs @@ -1,29 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsTreeJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsTreeJoined.cs index 5a4f0eab..ea0ee116 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsTreeJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsTreeJoined.cs @@ -1,299 +1,299 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUser.cs b/Migration.Toolkit.KX12/Models/ViewCmsUser.cs index 092a6297..893a731e 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUser.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUser.cs @@ -1,215 +1,215 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserDocument.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserDocument.cs index cfc764f4..4887bb89 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserDocument.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUserDocument.cs @@ -1,56 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleJoined.cs index 78dd6371..2c61a333 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleJoined.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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRole.cs index 180aa819..af8f9baa 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRole.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRole.cs @@ -1,25 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs index 005ad175..cc18e998 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs @@ -1,19 +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] -public partial class ViewCmsUserRoleMembershipRoleValidOnlyJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserSettingsRoleJoined.cs index 27c3ccd9..27939fad 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserSettingsRoleJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUserSettingsRoleJoined.cs @@ -1,42 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs index 35bfc444..2017441a 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs @@ -1,68 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs index d4ad74ad..9a29d26e 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs @@ -1,64 +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 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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Toolkit.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs index 4e94fbae..2cf6b1d9 100644 --- a/Migration.Toolkit.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs @@ -1,64 +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 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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCommunityGroup.cs b/Migration.Toolkit.KX12/Models/ViewCommunityGroup.cs index 621c3337..6c701253 100644 --- a/Migration.Toolkit.KX12/Models/ViewCommunityGroup.cs +++ b/Migration.Toolkit.KX12/Models/ViewCommunityGroup.cs @@ -1,67 +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 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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewCommunityMember.cs b/Migration.Toolkit.KX12/Models/ViewCommunityMember.cs index e995ec5d..ab8afeee 100644 --- a/Migration.Toolkit.KX12/Models/ViewCommunityMember.cs +++ b/Migration.Toolkit.KX12/Models/ViewCommunityMember.cs @@ -1,246 +1,246 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewForumsGroupForumPostJoined.cs b/Migration.Toolkit.KX12/Models/ViewForumsGroupForumPostJoined.cs index eb821483..018090c2 100644 --- a/Migration.Toolkit.KX12/Models/ViewForumsGroupForumPostJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewForumsGroupForumPostJoined.cs @@ -1,228 +1,228 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewIntegrationTaskJoined.cs b/Migration.Toolkit.KX12/Models/ViewIntegrationTaskJoined.cs index 20a757e0..0fe3a913 100644 --- a/Migration.Toolkit.KX12/Models/ViewIntegrationTaskJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewIntegrationTaskJoined.cs @@ -1,65 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Toolkit.KX12/Models/ViewMembershipMembershipUserJoined.cs index 2d1574b4..8dbdc4b1 100644 --- a/Migration.Toolkit.KX12/Models/ViewMembershipMembershipUserJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewMembershipMembershipUserJoined.cs @@ -1,31 +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 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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Toolkit.KX12/Models/ViewNewsletterSubscriptionsJoined.cs index 75e78203..cc8fe86c 100644 --- a/Migration.Toolkit.KX12/Models/ViewNewsletterSubscriptionsJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewNewsletterSubscriptionsJoined.cs @@ -1,39 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmAccountContactAccountJoined.cs index 1f4d71c8..c80e4c28 100644 --- a/Migration.Toolkit.KX12/Models/ViewOmAccountContactAccountJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewOmAccountContactAccountJoined.cs @@ -1,32 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmAccountContactContactJoined.cs index 7bbd2ddc..f4595f75 100644 --- a/Migration.Toolkit.KX12/Models/ViewOmAccountContactContactJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewOmAccountContactContactJoined.cs @@ -1,41 +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 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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmAccountJoined.cs index a97efa2f..c7d5c44c 100644 --- a/Migration.Toolkit.KX12/Models/ViewOmAccountJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewOmAccountJoined.cs @@ -1,102 +1,102 @@ -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!; -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs index 59584c45..5be5678a 100644 --- a/Migration.Toolkit.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -1,78 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewPollAnswerCount.cs b/Migration.Toolkit.KX12/Models/ViewPollAnswerCount.cs index e8a24875..9d6a0bf9 100644 --- a/Migration.Toolkit.KX12/Models/ViewPollAnswerCount.cs +++ b/Migration.Toolkit.KX12/Models/ViewPollAnswerCount.cs @@ -1,52 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX12/Models/ViewReportingCategoryReportJoined.cs b/Migration.Toolkit.KX12/Models/ViewReportingCategoryReportJoined.cs index 805bdb4d..d8f6fcbe 100644 --- a/Migration.Toolkit.KX12/Models/ViewReportingCategoryReportJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewReportingCategoryReportJoined.cs @@ -1,52 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX12/SettingsKeys.cs b/Migration.Toolkit.KX12/SettingsKeys.cs index a394a98e..ba16c518 100644 --- a/Migration.Toolkit.KX12/SettingsKeys.cs +++ b/Migration.Toolkit.KX12/SettingsKeys.cs @@ -1,748 +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"; +// 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 diff --git a/Migration.Toolkit.KX13/Context/KX13Context.cs b/Migration.Toolkit.KX13/Context/KX13Context.cs index 6f1559b2..cc7ba22f 100644 --- a/Migration.Toolkit.KX13/Context/KX13Context.cs +++ b/Migration.Toolkit.KX13/Context/KX13Context.cs @@ -1,4096 +1,4096 @@ -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); -} +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 diff --git a/Migration.Toolkit.KX13/DependencyInjectionExtensions.cs b/Migration.Toolkit.KX13/DependencyInjectionExtensions.cs index 9eeddce9..489f6b33 100644 --- a/Migration.Toolkit.KX13/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.KX13/DependencyInjectionExtensions.cs @@ -1,15 +1,15 @@ -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; - } +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 diff --git a/Migration.Toolkit.KX13/KX13ContextCustomizations.cs b/Migration.Toolkit.KX13/KX13ContextCustomizations.cs index 66d71047..1a3eca6b 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); - } +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaign.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaign.cs index e98bb734..37e3d56b 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaign.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaign.cs @@ -1,74 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAsset.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignAsset.cs index 664e8a2d..897d5190 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAsset.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaignAsset.cs @@ -1,35 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignAssetUrl.cs index ca07f893..057ccc08 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAssetUrl.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaignAssetUrl.cs @@ -1,30 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversion.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversion.cs index 3b139b50..0142adc2 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversion.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversion.cs @@ -1,56 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversionHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversionHit.cs index 336b827c..96b4df8a 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversionHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversionHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignObjective.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignObjective.cs index ab448536..0943f173 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignObjective.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaignObjective.cs @@ -1,37 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsDayHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsDayHit.cs index 1065b154..01d9e92d 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsDayHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsDayHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsExitPage.cs b/Migration.Toolkit.KX13/Models/AnalyticsExitPage.cs index 99a9bb5c..741eee17 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsExitPage.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsExitPage.cs @@ -1,33 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsHourHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsHourHit.cs index 1bd5984c..777d914e 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsHourHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsHourHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsMonthHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsMonthHit.cs index d0aa8a73..d562bc79 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsMonthHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsMonthHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsStatistic.cs b/Migration.Toolkit.KX13/Models/AnalyticsStatistic.cs index 069bdbc1..0567d180 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsStatistic.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsStatistic.cs @@ -1,50 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsWeekHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsWeekHit.cs index 3a3a3aee..af7c3525 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsWeekHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsWeekHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/AnalyticsYearHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsYearHit.cs index 5be0db6a..484eeb6e 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsYearHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsYearHit.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CiFileMetadatum.cs b/Migration.Toolkit.KX13/Models/CiFileMetadatum.cs index d95d141b..69d3e0d8 100644 --- a/Migration.Toolkit.KX13/Models/CiFileMetadatum.cs +++ b/Migration.Toolkit.KX13/Models/CiFileMetadatum.cs @@ -1,22 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CiMigration.cs b/Migration.Toolkit.KX13/Models/CiMigration.cs index 3f20ef62..9598053a 100644 --- a/Migration.Toolkit.KX13/Models/CiMigration.cs +++ b/Migration.Toolkit.KX13/Models/CiMigration.cs @@ -1,24 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsAcl.cs b/Migration.Toolkit.KX13/Models/CmsAcl.cs index 223588d1..aae71c90 100644 --- a/Migration.Toolkit.KX13/Models/CmsAcl.cs +++ b/Migration.Toolkit.KX13/Models/CmsAcl.cs @@ -1,39 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsAclitem.cs b/Migration.Toolkit.KX13/Models/CmsAclitem.cs index 07bd1f42..984959ef 100644 --- a/Migration.Toolkit.KX13/Models/CmsAclitem.cs +++ b/Migration.Toolkit.KX13/Models/CmsAclitem.cs @@ -1,56 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsAlternativeForm.cs b/Migration.Toolkit.KX13/Models/CmsAlternativeForm.cs index bc497fce..6efe2059 100644 --- a/Migration.Toolkit.KX13/Models/CmsAlternativeForm.cs +++ b/Migration.Toolkit.KX13/Models/CmsAlternativeForm.cs @@ -1,60 +1,60 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsAlternativeUrl.cs b/Migration.Toolkit.KX13/Models/CmsAlternativeUrl.cs index 82dfaca1..1dce6fb6 100644 --- a/Migration.Toolkit.KX13/Models/CmsAlternativeUrl.cs +++ b/Migration.Toolkit.KX13/Models/CmsAlternativeUrl.cs @@ -1,39 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsAttachment.cs b/Migration.Toolkit.KX13/Models/CmsAttachment.cs index e97b54f3..00b396c2 100644 --- a/Migration.Toolkit.KX13/Models/CmsAttachment.cs +++ b/Migration.Toolkit.KX13/Models/CmsAttachment.cs @@ -1,91 +1,91 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsAttachmentHistory.cs b/Migration.Toolkit.KX13/Models/CmsAttachmentHistory.cs index 07b0e8f7..0e930aca 100644 --- a/Migration.Toolkit.KX13/Models/CmsAttachmentHistory.cs +++ b/Migration.Toolkit.KX13/Models/CmsAttachmentHistory.cs @@ -1,90 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsAutomationHistory.cs b/Migration.Toolkit.KX13/Models/CmsAutomationHistory.cs index b89d33d9..6c743065 100644 --- a/Migration.Toolkit.KX13/Models/CmsAutomationHistory.cs +++ b/Migration.Toolkit.KX13/Models/CmsAutomationHistory.cs @@ -1,82 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsAutomationState.cs b/Migration.Toolkit.KX13/Models/CmsAutomationState.cs index d404eeb5..c4ccce89 100644 --- a/Migration.Toolkit.KX13/Models/CmsAutomationState.cs +++ b/Migration.Toolkit.KX13/Models/CmsAutomationState.cs @@ -1,71 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsAutomationTemplate.cs b/Migration.Toolkit.KX13/Models/CmsAutomationTemplate.cs index b688294a..43fc5e4e 100644 --- a/Migration.Toolkit.KX13/Models/CmsAutomationTemplate.cs +++ b/Migration.Toolkit.KX13/Models/CmsAutomationTemplate.cs @@ -1,30 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsAvatar.cs b/Migration.Toolkit.KX13/Models/CmsAvatar.cs index e8071fa7..be2da84f 100644 --- a/Migration.Toolkit.KX13/Models/CmsAvatar.cs +++ b/Migration.Toolkit.KX13/Models/CmsAvatar.cs @@ -1,44 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsCategory.cs b/Migration.Toolkit.KX13/Models/CmsCategory.cs index be2dc8e9..b85cec14 100644 --- a/Migration.Toolkit.KX13/Models/CmsCategory.cs +++ b/Migration.Toolkit.KX13/Models/CmsCategory.cs @@ -1,67 +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; - -[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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsClass.cs b/Migration.Toolkit.KX13/Models/CmsClass.cs index 7ba3f478..10e3be81 100644 --- a/Migration.Toolkit.KX13/Models/CmsClass.cs +++ b/Migration.Toolkit.KX13/Models/CmsClass.cs @@ -1,196 +1,196 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsConsent.cs b/Migration.Toolkit.KX13/Models/CmsConsent.cs index e081d832..fd93e053 100644 --- a/Migration.Toolkit.KX13/Models/CmsConsent.cs +++ b/Migration.Toolkit.KX13/Models/CmsConsent.cs @@ -1,36 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsConsentAgreement.cs b/Migration.Toolkit.KX13/Models/CmsConsentAgreement.cs index 790692d1..600a12ca 100644 --- a/Migration.Toolkit.KX13/Models/CmsConsentAgreement.cs +++ b/Migration.Toolkit.KX13/Models/CmsConsentAgreement.cs @@ -1,39 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsConsentArchive.cs b/Migration.Toolkit.KX13/Models/CmsConsentArchive.cs index de7e2c9e..992ad780 100644 --- a/Migration.Toolkit.KX13/Models/CmsConsentArchive.cs +++ b/Migration.Toolkit.KX13/Models/CmsConsentArchive.cs @@ -1,32 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsCountry.cs b/Migration.Toolkit.KX13/Models/CmsCountry.cs index 5fa2bd6a..83f7bcbb 100644 --- a/Migration.Toolkit.KX13/Models/CmsCountry.cs +++ b/Migration.Toolkit.KX13/Models/CmsCountry.cs @@ -1,50 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsCulture.cs b/Migration.Toolkit.KX13/Models/CmsCulture.cs index eca9ab8d..fc6dcf1d 100644 --- a/Migration.Toolkit.KX13/Models/CmsCulture.cs +++ b/Migration.Toolkit.KX13/Models/CmsCulture.cs @@ -1,54 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsDocument.cs b/Migration.Toolkit.KX13/Models/CmsDocument.cs index fdffafa0..28c78d4d 100644 --- a/Migration.Toolkit.KX13/Models/CmsDocument.cs +++ b/Migration.Toolkit.KX13/Models/CmsDocument.cs @@ -1,167 +1,167 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsDocumentTypeScope.cs b/Migration.Toolkit.KX13/Models/CmsDocumentTypeScope.cs index f1df92ba..58baa1b3 100644 --- a/Migration.Toolkit.KX13/Models/CmsDocumentTypeScope.cs +++ b/Migration.Toolkit.KX13/Models/CmsDocumentTypeScope.cs @@ -1,42 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsEmail.cs b/Migration.Toolkit.KX13/Models/CmsEmail.cs index b2ce2e0b..e92da4d8 100644 --- a/Migration.Toolkit.KX13/Models/CmsEmail.cs +++ b/Migration.Toolkit.KX13/Models/CmsEmail.cs @@ -1,69 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsEmailAttachment.cs b/Migration.Toolkit.KX13/Models/CmsEmailAttachment.cs index 0db69ada..1fc14af8 100644 --- a/Migration.Toolkit.KX13/Models/CmsEmailAttachment.cs +++ b/Migration.Toolkit.KX13/Models/CmsEmailAttachment.cs @@ -1,44 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsEmailTemplate.cs b/Migration.Toolkit.KX13/Models/CmsEmailTemplate.cs index d743c624..bfdf56ed 100644 --- a/Migration.Toolkit.KX13/Models/CmsEmailTemplate.cs +++ b/Migration.Toolkit.KX13/Models/CmsEmailTemplate.cs @@ -1,59 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsEmailUser.cs b/Migration.Toolkit.KX13/Models/CmsEmailUser.cs index 829a7183..6c09f303 100644 --- a/Migration.Toolkit.KX13/Models/CmsEmailUser.cs +++ b/Migration.Toolkit.KX13/Models/CmsEmailUser.cs @@ -1,36 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsEventLog.cs b/Migration.Toolkit.KX13/Models/CmsEventLog.cs index 00dbd26c..6f5a4094 100644 --- a/Migration.Toolkit.KX13/Models/CmsEventLog.cs +++ b/Migration.Toolkit.KX13/Models/CmsEventLog.cs @@ -1,57 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsExternalLogin.cs b/Migration.Toolkit.KX13/Models/CmsExternalLogin.cs index bdfe34ff..c4a61e1f 100644 --- a/Migration.Toolkit.KX13/Models/CmsExternalLogin.cs +++ b/Migration.Toolkit.KX13/Models/CmsExternalLogin.cs @@ -1,29 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsForm.cs b/Migration.Toolkit.KX13/Models/CmsForm.cs index f6e40440..49dd2941 100644 --- a/Migration.Toolkit.KX13/Models/CmsForm.cs +++ b/Migration.Toolkit.KX13/Models/CmsForm.cs @@ -1,94 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsFormUserControl.cs b/Migration.Toolkit.KX13/Models/CmsFormUserControl.cs index 2d01b700..25ec5cfd 100644 --- a/Migration.Toolkit.KX13/Models/CmsFormUserControl.cs +++ b/Migration.Toolkit.KX13/Models/CmsFormUserControl.cs @@ -1,95 +1,95 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsHelpTopic.cs b/Migration.Toolkit.KX13/Models/CmsHelpTopic.cs index 3a9d5675..fded87e0 100644 --- a/Migration.Toolkit.KX13/Models/CmsHelpTopic.cs +++ b/Migration.Toolkit.KX13/Models/CmsHelpTopic.cs @@ -1,38 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsLayout.cs b/Migration.Toolkit.KX13/Models/CmsLayout.cs index b345011a..6b1aa3bb 100644 --- a/Migration.Toolkit.KX13/Models/CmsLayout.cs +++ b/Migration.Toolkit.KX13/Models/CmsLayout.cs @@ -1,44 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsLicenseKey.cs b/Migration.Toolkit.KX13/Models/CmsLicenseKey.cs index dcbb9dd7..8cc7b1fa 100644 --- a/Migration.Toolkit.KX13/Models/CmsLicenseKey.cs +++ b/Migration.Toolkit.KX13/Models/CmsLicenseKey.cs @@ -1,28 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsMacroIdentity.cs b/Migration.Toolkit.KX13/Models/CmsMacroIdentity.cs index 7ee4e78e..0c3ba484 100644 --- a/Migration.Toolkit.KX13/Models/CmsMacroIdentity.cs +++ b/Migration.Toolkit.KX13/Models/CmsMacroIdentity.cs @@ -1,33 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsMacroRule.cs b/Migration.Toolkit.KX13/Models/CmsMacroRule.cs index 219e2972..24e9d79e 100644 --- a/Migration.Toolkit.KX13/Models/CmsMacroRule.cs +++ b/Migration.Toolkit.KX13/Models/CmsMacroRule.cs @@ -1,50 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsMembership.cs b/Migration.Toolkit.KX13/Models/CmsMembership.cs index a603320e..feb7f8d2 100644 --- a/Migration.Toolkit.KX13/Models/CmsMembership.cs +++ b/Migration.Toolkit.KX13/Models/CmsMembership.cs @@ -1,43 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsMembershipUser.cs b/Migration.Toolkit.KX13/Models/CmsMembershipUser.cs index 44b1f596..e2036e83 100644 --- a/Migration.Toolkit.KX13/Models/CmsMembershipUser.cs +++ b/Migration.Toolkit.KX13/Models/CmsMembershipUser.cs @@ -1,35 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsMetaFile.cs b/Migration.Toolkit.KX13/Models/CmsMetaFile.cs index 09a30b18..ee04a742 100644 --- a/Migration.Toolkit.KX13/Models/CmsMetaFile.cs +++ b/Migration.Toolkit.KX13/Models/CmsMetaFile.cs @@ -1,62 +1,62 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsModuleLicenseKey.cs b/Migration.Toolkit.KX13/Models/CmsModuleLicenseKey.cs index 4e40f489..90d229d8 100644 --- a/Migration.Toolkit.KX13/Models/CmsModuleLicenseKey.cs +++ b/Migration.Toolkit.KX13/Models/CmsModuleLicenseKey.cs @@ -1,29 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsModuleUsageCounter.cs b/Migration.Toolkit.KX13/Models/CmsModuleUsageCounter.cs index abdcc44c..2393d763 100644 --- a/Migration.Toolkit.KX13/Models/CmsModuleUsageCounter.cs +++ b/Migration.Toolkit.KX13/Models/CmsModuleUsageCounter.cs @@ -1,20 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsObjectSetting.cs b/Migration.Toolkit.KX13/Models/CmsObjectSetting.cs index 491e4bfe..55f1b37c 100644 --- a/Migration.Toolkit.KX13/Models/CmsObjectSetting.cs +++ b/Migration.Toolkit.KX13/Models/CmsObjectSetting.cs @@ -1,62 +1,62 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsObjectVersionHistory.cs b/Migration.Toolkit.KX13/Models/CmsObjectVersionHistory.cs index 5eaefdca..e2f8f899 100644 --- a/Migration.Toolkit.KX13/Models/CmsObjectVersionHistory.cs +++ b/Migration.Toolkit.KX13/Models/CmsObjectVersionHistory.cs @@ -1,73 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.KX13/Models/CmsObjectWorkflowTrigger.cs index bfe0d899..2f8d707d 100644 --- a/Migration.Toolkit.KX13/Models/CmsObjectWorkflowTrigger.cs +++ b/Migration.Toolkit.KX13/Models/CmsObjectWorkflowTrigger.cs @@ -1,46 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsPageFormerUrlPath.cs b/Migration.Toolkit.KX13/Models/CmsPageFormerUrlPath.cs index a07ba82a..efe01526 100644 --- a/Migration.Toolkit.KX13/Models/CmsPageFormerUrlPath.cs +++ b/Migration.Toolkit.KX13/Models/CmsPageFormerUrlPath.cs @@ -1,43 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsPageTemplate.cs b/Migration.Toolkit.KX13/Models/CmsPageTemplate.cs index fe2ab0ad..7e45290a 100644 --- a/Migration.Toolkit.KX13/Models/CmsPageTemplate.cs +++ b/Migration.Toolkit.KX13/Models/CmsPageTemplate.cs @@ -1,74 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsPageTemplateCategory.cs b/Migration.Toolkit.KX13/Models/CmsPageTemplateCategory.cs index e1da99a5..68efe31d 100644 --- a/Migration.Toolkit.KX13/Models/CmsPageTemplateCategory.cs +++ b/Migration.Toolkit.KX13/Models/CmsPageTemplateCategory.cs @@ -1,52 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsPageTemplateConfiguration.cs b/Migration.Toolkit.KX13/Models/CmsPageTemplateConfiguration.cs index 91579f69..26bdf5dc 100644 --- a/Migration.Toolkit.KX13/Models/CmsPageTemplateConfiguration.cs +++ b/Migration.Toolkit.KX13/Models/CmsPageTemplateConfiguration.cs @@ -1,40 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsPageUrlPath.cs b/Migration.Toolkit.KX13/Models/CmsPageUrlPath.cs index b7bbc922..2d3d8b33 100644 --- a/Migration.Toolkit.KX13/Models/CmsPageUrlPath.cs +++ b/Migration.Toolkit.KX13/Models/CmsPageUrlPath.cs @@ -1,46 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsPermission.cs b/Migration.Toolkit.KX13/Models/CmsPermission.cs index cb5adb98..adfc1575 100644 --- a/Migration.Toolkit.KX13/Models/CmsPermission.cs +++ b/Migration.Toolkit.KX13/Models/CmsPermission.cs @@ -1,60 +1,60 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsPersonalization.cs b/Migration.Toolkit.KX13/Models/CmsPersonalization.cs index cff70a76..893e9f64 100644 --- a/Migration.Toolkit.KX13/Models/CmsPersonalization.cs +++ b/Migration.Toolkit.KX13/Models/CmsPersonalization.cs @@ -1,41 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsQuery.cs b/Migration.Toolkit.KX13/Models/CmsQuery.cs index 56027f43..05e0ad71 100644 --- a/Migration.Toolkit.KX13/Models/CmsQuery.cs +++ b/Migration.Toolkit.KX13/Models/CmsQuery.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.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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsRelationship.cs b/Migration.Toolkit.KX13/Models/CmsRelationship.cs index 08f43e3e..4ca4649d 100644 --- a/Migration.Toolkit.KX13/Models/CmsRelationship.cs +++ b/Migration.Toolkit.KX13/Models/CmsRelationship.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.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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsRelationshipName.cs b/Migration.Toolkit.KX13/Models/CmsRelationshipName.cs index 4592a3bf..131bfe34 100644 --- a/Migration.Toolkit.KX13/Models/CmsRelationshipName.cs +++ b/Migration.Toolkit.KX13/Models/CmsRelationshipName.cs @@ -1,39 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsResource.cs b/Migration.Toolkit.KX13/Models/CmsResource.cs index d015b623..25b42c57 100644 --- a/Migration.Toolkit.KX13/Models/CmsResource.cs +++ b/Migration.Toolkit.KX13/Models/CmsResource.cs @@ -1,85 +1,85 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsResourceLibrary.cs b/Migration.Toolkit.KX13/Models/CmsResourceLibrary.cs index 73ebb9db..85fb87cb 100644 --- a/Migration.Toolkit.KX13/Models/CmsResourceLibrary.cs +++ b/Migration.Toolkit.KX13/Models/CmsResourceLibrary.cs @@ -1,26 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsResourceString.cs b/Migration.Toolkit.KX13/Models/CmsResourceString.cs index d84f3d26..2cb81d21 100644 --- a/Migration.Toolkit.KX13/Models/CmsResourceString.cs +++ b/Migration.Toolkit.KX13/Models/CmsResourceString.cs @@ -1,27 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsResourceTranslation.cs b/Migration.Toolkit.KX13/Models/CmsResourceTranslation.cs index ca748460..cc65c9fa 100644 --- a/Migration.Toolkit.KX13/Models/CmsResourceTranslation.cs +++ b/Migration.Toolkit.KX13/Models/CmsResourceTranslation.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsRole.cs b/Migration.Toolkit.KX13/Models/CmsRole.cs index bc91793e..0d5c5d62 100644 --- a/Migration.Toolkit.KX13/Models/CmsRole.cs +++ b/Migration.Toolkit.KX13/Models/CmsRole.cs @@ -1,73 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsScheduledTask.cs b/Migration.Toolkit.KX13/Models/CmsScheduledTask.cs index a43f146d..f37f4bb4 100644 --- a/Migration.Toolkit.KX13/Models/CmsScheduledTask.cs +++ b/Migration.Toolkit.KX13/Models/CmsScheduledTask.cs @@ -1,114 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsSearchEngine.cs b/Migration.Toolkit.KX13/Models/CmsSearchEngine.cs index 0e66d95c..4440f0d6 100644 --- a/Migration.Toolkit.KX13/Models/CmsSearchEngine.cs +++ b/Migration.Toolkit.KX13/Models/CmsSearchEngine.cs @@ -1,35 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsSearchIndex.cs b/Migration.Toolkit.KX13/Models/CmsSearchIndex.cs index 316fec6f..aa16d5fc 100644 --- a/Migration.Toolkit.KX13/Models/CmsSearchIndex.cs +++ b/Migration.Toolkit.KX13/Models/CmsSearchIndex.cs @@ -1,77 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsSearchTask.cs b/Migration.Toolkit.KX13/Models/CmsSearchTask.cs index 497a54a4..4a6f821b 100644 --- a/Migration.Toolkit.KX13/Models/CmsSearchTask.cs +++ b/Migration.Toolkit.KX13/Models/CmsSearchTask.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.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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsSearchTaskAzure.cs b/Migration.Toolkit.KX13/Models/CmsSearchTaskAzure.cs index 28906865..1ce6fa61 100644 --- a/Migration.Toolkit.KX13/Models/CmsSearchTaskAzure.cs +++ b/Migration.Toolkit.KX13/Models/CmsSearchTaskAzure.cs @@ -1,40 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsSettingsCategory.cs b/Migration.Toolkit.KX13/Models/CmsSettingsCategory.cs index 9993a38c..83986bea 100644 --- a/Migration.Toolkit.KX13/Models/CmsSettingsCategory.cs +++ b/Migration.Toolkit.KX13/Models/CmsSettingsCategory.cs @@ -1,60 +1,60 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsSettingsKey.cs b/Migration.Toolkit.KX13/Models/CmsSettingsKey.cs index c7b6b3ce..8e72f866 100644 --- a/Migration.Toolkit.KX13/Models/CmsSettingsKey.cs +++ b/Migration.Toolkit.KX13/Models/CmsSettingsKey.cs @@ -1,69 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsSite.cs b/Migration.Toolkit.KX13/Models/CmsSite.cs index f5f615a1..89de8e40 100644 --- a/Migration.Toolkit.KX13/Models/CmsSite.cs +++ b/Migration.Toolkit.KX13/Models/CmsSite.cs @@ -1,311 +1,311 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsSiteDomainAlias.cs b/Migration.Toolkit.KX13/Models/CmsSiteDomainAlias.cs index 3c940c4e..1719c229 100644 --- a/Migration.Toolkit.KX13/Models/CmsSiteDomainAlias.cs +++ b/Migration.Toolkit.KX13/Models/CmsSiteDomainAlias.cs @@ -1,40 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsSmtpserver.cs b/Migration.Toolkit.KX13/Models/CmsSmtpserver.cs index 241e9a0c..372fe6cd 100644 --- a/Migration.Toolkit.KX13/Models/CmsSmtpserver.cs +++ b/Migration.Toolkit.KX13/Models/CmsSmtpserver.cs @@ -1,47 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsState.cs b/Migration.Toolkit.KX13/Models/CmsState.cs index 0791beb2..97540d4c 100644 --- a/Migration.Toolkit.KX13/Models/CmsState.cs +++ b/Migration.Toolkit.KX13/Models/CmsState.cs @@ -1,53 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsTag.cs b/Migration.Toolkit.KX13/Models/CmsTag.cs index 772ccf9d..df626de1 100644 --- a/Migration.Toolkit.KX13/Models/CmsTag.cs +++ b/Migration.Toolkit.KX13/Models/CmsTag.cs @@ -1,35 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsTagGroup.cs b/Migration.Toolkit.KX13/Models/CmsTagGroup.cs index 360c9057..3df7be83 100644 --- a/Migration.Toolkit.KX13/Models/CmsTagGroup.cs +++ b/Migration.Toolkit.KX13/Models/CmsTagGroup.cs @@ -1,44 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsTimeZone.cs b/Migration.Toolkit.KX13/Models/CmsTimeZone.cs index d8453f61..7ad6fd70 100644 --- a/Migration.Toolkit.KX13/Models/CmsTimeZone.cs +++ b/Migration.Toolkit.KX13/Models/CmsTimeZone.cs @@ -1,44 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsTransformation.cs b/Migration.Toolkit.KX13/Models/CmsTransformation.cs index e3ec1f89..08e1b23a 100644 --- a/Migration.Toolkit.KX13/Models/CmsTransformation.cs +++ b/Migration.Toolkit.KX13/Models/CmsTransformation.cs @@ -1,40 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsTranslationService.cs b/Migration.Toolkit.KX13/Models/CmsTranslationService.cs index 54dae392..feb8d81e 100644 --- a/Migration.Toolkit.KX13/Models/CmsTranslationService.cs +++ b/Migration.Toolkit.KX13/Models/CmsTranslationService.cs @@ -1,52 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsTranslationSubmission.cs b/Migration.Toolkit.KX13/Models/CmsTranslationSubmission.cs index 0145c1bc..3d951b0b 100644 --- a/Migration.Toolkit.KX13/Models/CmsTranslationSubmission.cs +++ b/Migration.Toolkit.KX13/Models/CmsTranslationSubmission.cs @@ -1,76 +1,76 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsTranslationSubmissionItem.cs b/Migration.Toolkit.KX13/Models/CmsTranslationSubmissionItem.cs index 0677e4c1..95f18ef0 100644 --- a/Migration.Toolkit.KX13/Models/CmsTranslationSubmissionItem.cs +++ b/Migration.Toolkit.KX13/Models/CmsTranslationSubmissionItem.cs @@ -1,58 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsTree.cs b/Migration.Toolkit.KX13/Models/CmsTree.cs index b32bc000..836a8a16 100644 --- a/Migration.Toolkit.KX13/Models/CmsTree.cs +++ b/Migration.Toolkit.KX13/Models/CmsTree.cs @@ -1,141 +1,141 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsUielement.cs b/Migration.Toolkit.KX13/Models/CmsUielement.cs index 91086b67..ecfec680 100644 --- a/Migration.Toolkit.KX13/Models/CmsUielement.cs +++ b/Migration.Toolkit.KX13/Models/CmsUielement.cs @@ -1,116 +1,116 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsUser.cs b/Migration.Toolkit.KX13/Models/CmsUser.cs index d4d35095..4e52ab9b 100644 --- a/Migration.Toolkit.KX13/Models/CmsUser.cs +++ b/Migration.Toolkit.KX13/Models/CmsUser.cs @@ -1,224 +1,224 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsUserCulture.cs b/Migration.Toolkit.KX13/Models/CmsUserCulture.cs index 0d680213..ce19d591 100644 --- a/Migration.Toolkit.KX13/Models/CmsUserCulture.cs +++ b/Migration.Toolkit.KX13/Models/CmsUserCulture.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.KX13/Models/CmsUserMacroIdentity.cs index ff335e13..a5536776 100644 --- a/Migration.Toolkit.KX13/Models/CmsUserMacroIdentity.cs +++ b/Migration.Toolkit.KX13/Models/CmsUserMacroIdentity.cs @@ -1,35 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsUserRole.cs b/Migration.Toolkit.KX13/Models/CmsUserRole.cs index 947b3b72..c1e3b211 100644 --- a/Migration.Toolkit.KX13/Models/CmsUserRole.cs +++ b/Migration.Toolkit.KX13/Models/CmsUserRole.cs @@ -1,34 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsUserSetting.cs b/Migration.Toolkit.KX13/Models/CmsUserSetting.cs index 8b50f47e..bd01b94c 100644 --- a/Migration.Toolkit.KX13/Models/CmsUserSetting.cs +++ b/Migration.Toolkit.KX13/Models/CmsUserSetting.cs @@ -1,122 +1,122 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsUserSite.cs b/Migration.Toolkit.KX13/Models/CmsUserSite.cs index 8f30a271..e484a060 100644 --- a/Migration.Toolkit.KX13/Models/CmsUserSite.cs +++ b/Migration.Toolkit.KX13/Models/CmsUserSite.cs @@ -1,31 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsVersionHistory.cs b/Migration.Toolkit.KX13/Models/CmsVersionHistory.cs index 8571d2ea..8734d2aa 100644 --- a/Migration.Toolkit.KX13/Models/CmsVersionHistory.cs +++ b/Migration.Toolkit.KX13/Models/CmsVersionHistory.cs @@ -1,108 +1,108 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServer.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServer.cs index 097a9ec3..a84c99ae 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServer.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebFarmServer.cs @@ -1,34 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServerLog.cs index 83ead282..86cf647d 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServerLog.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebFarmServerLog.cs @@ -1,23 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServerMonitoring.cs index 29d3ed07..48bbb08f 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServerMonitoring.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebFarmServerMonitoring.cs @@ -1,20 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServerTask.cs index 5fa279be..5c4b6fc9 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServerTask.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebFarmServerTask.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmTask.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmTask.cs index ef90981e..3c38cb80 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmTask.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebFarmTask.cs @@ -1,42 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWebPart.cs b/Migration.Toolkit.KX13/Models/CmsWebPart.cs index 2c220cf1..1f693c2f 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebPart.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebPart.cs @@ -1,84 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWebPartCategory.cs b/Migration.Toolkit.KX13/Models/CmsWebPartCategory.cs index a57bd769..b0a7f7a7 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebPartCategory.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebPartCategory.cs @@ -1,51 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWebPartContainer.cs b/Migration.Toolkit.KX13/Models/CmsWebPartContainer.cs index abbad237..48f93e1c 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebPartContainer.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebPartContainer.cs @@ -1,38 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWebPartLayout.cs b/Migration.Toolkit.KX13/Models/CmsWebPartLayout.cs index f62ccbba..0546ec48 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebPartLayout.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebPartLayout.cs @@ -1,50 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWidget.cs b/Migration.Toolkit.KX13/Models/CmsWidget.cs index e96b408b..5ee0586f 100644 --- a/Migration.Toolkit.KX13/Models/CmsWidget.cs +++ b/Migration.Toolkit.KX13/Models/CmsWidget.cs @@ -1,73 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWidgetCategory.cs b/Migration.Toolkit.KX13/Models/CmsWidgetCategory.cs index 2f8df3d9..9e1242a1 100644 --- a/Migration.Toolkit.KX13/Models/CmsWidgetCategory.cs +++ b/Migration.Toolkit.KX13/Models/CmsWidgetCategory.cs @@ -1,51 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWidgetRole.cs b/Migration.Toolkit.KX13/Models/CmsWidgetRole.cs index fed072ab..04376356 100644 --- a/Migration.Toolkit.KX13/Models/CmsWidgetRole.cs +++ b/Migration.Toolkit.KX13/Models/CmsWidgetRole.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflow.cs b/Migration.Toolkit.KX13/Models/CmsWorkflow.cs index e7c3334b..79dd2302 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflow.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflow.cs @@ -1,96 +1,96 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowAction.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowAction.cs index 9359630b..b446bdaf 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowAction.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowAction.cs @@ -1,72 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowHistory.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowHistory.cs index 100d9e29..6bf07e15 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowHistory.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowHistory.cs @@ -1,88 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowScope.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowScope.cs index 3d2079dd..b0f4df62 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowScope.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowScope.cs @@ -1,60 +1,60 @@ -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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowStep.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowStep.cs index 120cef2f..40f821c7 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowStep.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowStep.cs @@ -1,115 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowStepRole.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowStepRole.cs index ddc3ac18..9ffd24b8 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowStepRole.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowStepRole.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowStepUser.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowStepUser.cs index 273d6c65..70c00647 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowStepUser.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowStepUser.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowTransition.cs index 46b190c5..2ea43d07 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowTransition.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowTransition.cs @@ -1,46 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComAddress.cs b/Migration.Toolkit.KX13/Models/ComAddress.cs index 58129419..8d34bb05 100644 --- a/Migration.Toolkit.KX13/Models/ComAddress.cs +++ b/Migration.Toolkit.KX13/Models/ComAddress.cs @@ -1,74 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComBrand.cs b/Migration.Toolkit.KX13/Models/ComBrand.cs index e9e2239c..ad8c26f9 100644 --- a/Migration.Toolkit.KX13/Models/ComBrand.cs +++ b/Migration.Toolkit.KX13/Models/ComBrand.cs @@ -1,51 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComCarrier.cs b/Migration.Toolkit.KX13/Models/ComCarrier.cs index 3cb1fd08..8b600e9f 100644 --- a/Migration.Toolkit.KX13/Models/ComCarrier.cs +++ b/Migration.Toolkit.KX13/Models/ComCarrier.cs @@ -1,43 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComCollection.cs b/Migration.Toolkit.KX13/Models/ComCollection.cs index 2157ab28..901ba62c 100644 --- a/Migration.Toolkit.KX13/Models/ComCollection.cs +++ b/Migration.Toolkit.KX13/Models/ComCollection.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.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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComCouponCode.cs b/Migration.Toolkit.KX13/Models/ComCouponCode.cs index 6e7d609b..ff134612 100644 --- a/Migration.Toolkit.KX13/Models/ComCouponCode.cs +++ b/Migration.Toolkit.KX13/Models/ComCouponCode.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComCurrency.cs b/Migration.Toolkit.KX13/Models/ComCurrency.cs index 3150f715..2387affa 100644 --- a/Migration.Toolkit.KX13/Models/ComCurrency.cs +++ b/Migration.Toolkit.KX13/Models/ComCurrency.cs @@ -1,56 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComCurrencyExchangeRate.cs b/Migration.Toolkit.KX13/Models/ComCurrencyExchangeRate.cs index e91d28a2..e4dd9fd4 100644 --- a/Migration.Toolkit.KX13/Models/ComCurrencyExchangeRate.cs +++ b/Migration.Toolkit.KX13/Models/ComCurrencyExchangeRate.cs @@ -1,39 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComCustomer.cs b/Migration.Toolkit.KX13/Models/ComCustomer.cs index 3db4f91e..c7150afb 100644 --- a/Migration.Toolkit.KX13/Models/ComCustomer.cs +++ b/Migration.Toolkit.KX13/Models/ComCustomer.cs @@ -1,79 +1,79 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComCustomerCreditHistory.cs b/Migration.Toolkit.KX13/Models/ComCustomerCreditHistory.cs index 2f2d588f..b04b4526 100644 --- a/Migration.Toolkit.KX13/Models/ComCustomerCreditHistory.cs +++ b/Migration.Toolkit.KX13/Models/ComCustomerCreditHistory.cs @@ -1,46 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComDepartment.cs b/Migration.Toolkit.KX13/Models/ComDepartment.cs index a57cd2fd..61f61b4b 100644 --- a/Migration.Toolkit.KX13/Models/ComDepartment.cs +++ b/Migration.Toolkit.KX13/Models/ComDepartment.cs @@ -1,51 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComDiscount.cs b/Migration.Toolkit.KX13/Models/ComDiscount.cs index 57a08795..ee38626d 100644 --- a/Migration.Toolkit.KX13/Models/ComDiscount.cs +++ b/Migration.Toolkit.KX13/Models/ComDiscount.cs @@ -1,74 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComExchangeTable.cs b/Migration.Toolkit.KX13/Models/ComExchangeTable.cs index 33dcfd42..5c3505d4 100644 --- a/Migration.Toolkit.KX13/Models/ComExchangeTable.cs +++ b/Migration.Toolkit.KX13/Models/ComExchangeTable.cs @@ -1,41 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComGiftCard.cs b/Migration.Toolkit.KX13/Models/ComGiftCard.cs index 2cc829d9..813f2355 100644 --- a/Migration.Toolkit.KX13/Models/ComGiftCard.cs +++ b/Migration.Toolkit.KX13/Models/ComGiftCard.cs @@ -1,59 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComGiftCardCouponCode.cs b/Migration.Toolkit.KX13/Models/ComGiftCardCouponCode.cs index 2987ce79..072f6c6e 100644 --- a/Migration.Toolkit.KX13/Models/ComGiftCardCouponCode.cs +++ b/Migration.Toolkit.KX13/Models/ComGiftCardCouponCode.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComInternalStatus.cs b/Migration.Toolkit.KX13/Models/ComInternalStatus.cs index 7742f08f..39e0da07 100644 --- a/Migration.Toolkit.KX13/Models/ComInternalStatus.cs +++ b/Migration.Toolkit.KX13/Models/ComInternalStatus.cs @@ -1,40 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComManufacturer.cs b/Migration.Toolkit.KX13/Models/ComManufacturer.cs index 572da70e..f818c137 100644 --- a/Migration.Toolkit.KX13/Models/ComManufacturer.cs +++ b/Migration.Toolkit.KX13/Models/ComManufacturer.cs @@ -1,48 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyCouponCode.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyCouponCode.cs index 3831fa70..ceddbce9 100644 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyCouponCode.cs +++ b/Migration.Toolkit.KX13/Models/ComMultiBuyCouponCode.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscount.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscount.cs index 6171e0e4..70ac439a 100644 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscount.cs +++ b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscount.cs @@ -1,98 +1,98 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountBrand.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountBrand.cs index c7b51768..0eadc2f0 100644 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountBrand.cs +++ b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountBrand.cs @@ -1,32 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountCollection.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountCollection.cs index c44b4b65..bdb7897a 100644 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountCollection.cs +++ b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountCollection.cs @@ -1,32 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountTree.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountTree.cs index 943bb4d9..a5dd8998 100644 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountTree.cs +++ b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountTree.cs @@ -1,32 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComOptionCategory.cs b/Migration.Toolkit.KX13/Models/ComOptionCategory.cs index 26a68ba8..94d4d15c 100644 --- a/Migration.Toolkit.KX13/Models/ComOptionCategory.cs +++ b/Migration.Toolkit.KX13/Models/ComOptionCategory.cs @@ -1,66 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComOrder.cs b/Migration.Toolkit.KX13/Models/ComOrder.cs index 5775c24d..1e5e0d80 100644 --- a/Migration.Toolkit.KX13/Models/ComOrder.cs +++ b/Migration.Toolkit.KX13/Models/ComOrder.cs @@ -1,132 +1,132 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComOrderAddress.cs b/Migration.Toolkit.KX13/Models/ComOrderAddress.cs index 4a623b77..db20c946 100644 --- a/Migration.Toolkit.KX13/Models/ComOrderAddress.cs +++ b/Migration.Toolkit.KX13/Models/ComOrderAddress.cs @@ -1,64 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComOrderItem.cs b/Migration.Toolkit.KX13/Models/ComOrderItem.cs index 3a41ab09..23e02794 100644 --- a/Migration.Toolkit.KX13/Models/ComOrderItem.cs +++ b/Migration.Toolkit.KX13/Models/ComOrderItem.cs @@ -1,70 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComOrderItemSkufile.cs b/Migration.Toolkit.KX13/Models/ComOrderItemSkufile.cs index 3bbf3977..e724c1fa 100644 --- a/Migration.Toolkit.KX13/Models/ComOrderItemSkufile.cs +++ b/Migration.Toolkit.KX13/Models/ComOrderItemSkufile.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComOrderStatus.cs b/Migration.Toolkit.KX13/Models/ComOrderStatus.cs index e4154a40..b93a2c77 100644 --- a/Migration.Toolkit.KX13/Models/ComOrderStatus.cs +++ b/Migration.Toolkit.KX13/Models/ComOrderStatus.cs @@ -1,64 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComOrderStatusUser.cs b/Migration.Toolkit.KX13/Models/ComOrderStatusUser.cs index f2af053c..2cab8bd8 100644 --- a/Migration.Toolkit.KX13/Models/ComOrderStatusUser.cs +++ b/Migration.Toolkit.KX13/Models/ComOrderStatusUser.cs @@ -1,51 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComPaymentOption.cs b/Migration.Toolkit.KX13/Models/ComPaymentOption.cs index e2f40d3f..3dd35229 100644 --- a/Migration.Toolkit.KX13/Models/ComPaymentOption.cs +++ b/Migration.Toolkit.KX13/Models/ComPaymentOption.cs @@ -1,83 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComPublicStatus.cs b/Migration.Toolkit.KX13/Models/ComPublicStatus.cs index 6c1de49f..b319c134 100644 --- a/Migration.Toolkit.KX13/Models/ComPublicStatus.cs +++ b/Migration.Toolkit.KX13/Models/ComPublicStatus.cs @@ -1,40 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComShippingCost.cs b/Migration.Toolkit.KX13/Models/ComShippingCost.cs index ebb962d3..6a595dd4 100644 --- a/Migration.Toolkit.KX13/Models/ComShippingCost.cs +++ b/Migration.Toolkit.KX13/Models/ComShippingCost.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComShippingOption.cs b/Migration.Toolkit.KX13/Models/ComShippingOption.cs index 4d9c0da2..2b79e210 100644 --- a/Migration.Toolkit.KX13/Models/ComShippingOption.cs +++ b/Migration.Toolkit.KX13/Models/ComShippingOption.cs @@ -1,70 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComShoppingCart.cs b/Migration.Toolkit.KX13/Models/ComShoppingCart.cs index fbd6729d..4563a1bf 100644 --- a/Migration.Toolkit.KX13/Models/ComShoppingCart.cs +++ b/Migration.Toolkit.KX13/Models/ComShoppingCart.cs @@ -1,107 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComShoppingCartCouponCode.cs b/Migration.Toolkit.KX13/Models/ComShoppingCartCouponCode.cs index 4ff97f6f..76174dc0 100644 --- a/Migration.Toolkit.KX13/Models/ComShoppingCartCouponCode.cs +++ b/Migration.Toolkit.KX13/Models/ComShoppingCartCouponCode.cs @@ -1,26 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComShoppingCartSku.cs b/Migration.Toolkit.KX13/Models/ComShoppingCartSku.cs index e91044b5..d19c696e 100644 --- a/Migration.Toolkit.KX13/Models/ComShoppingCartSku.cs +++ b/Migration.Toolkit.KX13/Models/ComShoppingCartSku.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.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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComSku.cs b/Migration.Toolkit.KX13/Models/ComSku.cs index a69c2734..d6eca97b 100644 --- a/Migration.Toolkit.KX13/Models/ComSku.cs +++ b/Migration.Toolkit.KX13/Models/ComSku.cs @@ -1,270 +1,270 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComSkufile.cs b/Migration.Toolkit.KX13/Models/ComSkufile.cs index e4265f9e..6f3fb4c8 100644 --- a/Migration.Toolkit.KX13/Models/ComSkufile.cs +++ b/Migration.Toolkit.KX13/Models/ComSkufile.cs @@ -1,43 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComSkuoptionCategory.cs b/Migration.Toolkit.KX13/Models/ComSkuoptionCategory.cs index 7e075a54..8d012197 100644 --- a/Migration.Toolkit.KX13/Models/ComSkuoptionCategory.cs +++ b/Migration.Toolkit.KX13/Models/ComSkuoptionCategory.cs @@ -1,36 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComSupplier.cs b/Migration.Toolkit.KX13/Models/ComSupplier.cs index c38ba158..de11274c 100644 --- a/Migration.Toolkit.KX13/Models/ComSupplier.cs +++ b/Migration.Toolkit.KX13/Models/ComSupplier.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.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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComTaxClass.cs b/Migration.Toolkit.KX13/Models/ComTaxClass.cs index 101f1ed4..b4d022ba 100644 --- a/Migration.Toolkit.KX13/Models/ComTaxClass.cs +++ b/Migration.Toolkit.KX13/Models/ComTaxClass.cs @@ -1,52 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComTaxClassCountry.cs b/Migration.Toolkit.KX13/Models/ComTaxClassCountry.cs index 24a6e215..7929fe16 100644 --- a/Migration.Toolkit.KX13/Models/ComTaxClassCountry.cs +++ b/Migration.Toolkit.KX13/Models/ComTaxClassCountry.cs @@ -1,34 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComTaxClassState.cs b/Migration.Toolkit.KX13/Models/ComTaxClassState.cs index aa51698f..09d1d139 100644 --- a/Migration.Toolkit.KX13/Models/ComTaxClassState.cs +++ b/Migration.Toolkit.KX13/Models/ComTaxClassState.cs @@ -1,34 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComVolumeDiscount.cs b/Migration.Toolkit.KX13/Models/ComVolumeDiscount.cs index 0bff9ad9..7c9e5429 100644 --- a/Migration.Toolkit.KX13/Models/ComVolumeDiscount.cs +++ b/Migration.Toolkit.KX13/Models/ComVolumeDiscount.cs @@ -1,35 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ComWishlist.cs b/Migration.Toolkit.KX13/Models/ComWishlist.cs index 2c2fff0c..df0ab62e 100644 --- a/Migration.Toolkit.KX13/Models/ComWishlist.cs +++ b/Migration.Toolkit.KX13/Models/ComWishlist.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ExportHistory.cs b/Migration.Toolkit.KX13/Models/ExportHistory.cs index b16bb5d2..45277bf5 100644 --- a/Migration.Toolkit.KX13/Models/ExportHistory.cs +++ b/Migration.Toolkit.KX13/Models/ExportHistory.cs @@ -1,38 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ExportTask.cs b/Migration.Toolkit.KX13/Models/ExportTask.cs index 34e8cb27..b3591f21 100644 --- a/Migration.Toolkit.KX13/Models/ExportTask.cs +++ b/Migration.Toolkit.KX13/Models/ExportTask.cs @@ -1,39 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/IntegrationConnector.cs b/Migration.Toolkit.KX13/Models/IntegrationConnector.cs index 686fde1e..8243b87b 100644 --- a/Migration.Toolkit.KX13/Models/IntegrationConnector.cs +++ b/Migration.Toolkit.KX13/Models/IntegrationConnector.cs @@ -1,36 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/IntegrationSyncLog.cs b/Migration.Toolkit.KX13/Models/IntegrationSyncLog.cs index c3d35849..d84f9f7c 100644 --- a/Migration.Toolkit.KX13/Models/IntegrationSyncLog.cs +++ b/Migration.Toolkit.KX13/Models/IntegrationSyncLog.cs @@ -1,27 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/IntegrationSynchronization.cs b/Migration.Toolkit.KX13/Models/IntegrationSynchronization.cs index a66b70ff..fa5c0255 100644 --- a/Migration.Toolkit.KX13/Models/IntegrationSynchronization.cs +++ b/Migration.Toolkit.KX13/Models/IntegrationSynchronization.cs @@ -1,40 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/IntegrationTask.cs b/Migration.Toolkit.KX13/Models/IntegrationTask.cs index 1fe19685..a4768494 100644 --- a/Migration.Toolkit.KX13/Models/IntegrationTask.cs +++ b/Migration.Toolkit.KX13/Models/IntegrationTask.cs @@ -1,60 +1,60 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/MediaFile.cs b/Migration.Toolkit.KX13/Models/MediaFile.cs index 771f003d..122c5138 100644 --- a/Migration.Toolkit.KX13/Models/MediaFile.cs +++ b/Migration.Toolkit.KX13/Models/MediaFile.cs @@ -1,78 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/MediaLibrary.cs b/Migration.Toolkit.KX13/Models/MediaLibrary.cs index a54f32b8..26386775 100644 --- a/Migration.Toolkit.KX13/Models/MediaLibrary.cs +++ b/Migration.Toolkit.KX13/Models/MediaLibrary.cs @@ -1,55 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/MediaLibraryRolePermission.cs b/Migration.Toolkit.KX13/Models/MediaLibraryRolePermission.cs index 97a359db..d2967895 100644 --- a/Migration.Toolkit.KX13/Models/MediaLibraryRolePermission.cs +++ b/Migration.Toolkit.KX13/Models/MediaLibraryRolePermission.cs @@ -1,38 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterAbtest.cs b/Migration.Toolkit.KX13/Models/NewsletterAbtest.cs index aca57406..441ca374 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterAbtest.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterAbtest.cs @@ -1,54 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterClickedLink.cs b/Migration.Toolkit.KX13/Models/NewsletterClickedLink.cs index e0615ebe..843e850b 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterClickedLink.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterClickedLink.cs @@ -1,30 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmail.cs b/Migration.Toolkit.KX13/Models/NewsletterEmail.cs index 1699837a..a021e07f 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterEmail.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterEmail.cs @@ -1,56 +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_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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmailTemplate.cs b/Migration.Toolkit.KX13/Models/NewsletterEmailTemplate.cs index c9eb3087..3ec9898f 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterEmailTemplate.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterEmailTemplate.cs @@ -1,69 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmailWidget.cs b/Migration.Toolkit.KX13/Models/NewsletterEmailWidget.cs index b96cf5de..f44ddf43 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterEmailWidget.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterEmailWidget.cs @@ -1,48 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Toolkit.KX13/Models/NewsletterEmailWidgetTemplate.cs index 6b0a6500..77a9ae14 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterEmailWidgetTemplate.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterEmailWidgetTemplate.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterIssueContactGroup.cs b/Migration.Toolkit.KX13/Models/NewsletterIssueContactGroup.cs index a382b021..05564615 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterIssueContactGroup.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterIssueContactGroup.cs @@ -1,26 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterLink.cs b/Migration.Toolkit.KX13/Models/NewsletterLink.cs index fb46ac26..8478afa5 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterLink.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterLink.cs @@ -1,34 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterNewsletter.cs b/Migration.Toolkit.KX13/Models/NewsletterNewsletter.cs index 8778d553..8ce94ee3 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterNewsletter.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterNewsletter.cs @@ -1,116 +1,116 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterNewsletterIssue.cs b/Migration.Toolkit.KX13/Models/NewsletterNewsletterIssue.cs index 0b1c475d..05fd5872 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterNewsletterIssue.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterNewsletterIssue.cs @@ -1,128 +1,128 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterOpenedEmail.cs b/Migration.Toolkit.KX13/Models/NewsletterOpenedEmail.cs index fa7b7fc3..295c30be 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterOpenedEmail.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterOpenedEmail.cs @@ -1,30 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterSubscriber.cs b/Migration.Toolkit.KX13/Models/NewsletterSubscriber.cs index b8de6bcf..6ac7ad27 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterSubscriber.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterSubscriber.cs @@ -1,57 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterSubscriberNewsletter.cs b/Migration.Toolkit.KX13/Models/NewsletterSubscriberNewsletter.cs index d82b4a10..e0d4a830 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterSubscriberNewsletter.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterSubscriberNewsletter.cs @@ -1,40 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/NewsletterUnsubscription.cs b/Migration.Toolkit.KX13/Models/NewsletterUnsubscription.cs index f61845df..0df0e616 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterUnsubscription.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterUnsubscription.cs @@ -1,40 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmAbtest.cs b/Migration.Toolkit.KX13/Models/OmAbtest.cs index e68e11b9..1d9c342e 100644 --- a/Migration.Toolkit.KX13/Models/OmAbtest.cs +++ b/Migration.Toolkit.KX13/Models/OmAbtest.cs @@ -1,69 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmAbvariantDatum.cs b/Migration.Toolkit.KX13/Models/OmAbvariantDatum.cs index 508da55b..a2050260 100644 --- a/Migration.Toolkit.KX13/Models/OmAbvariantDatum.cs +++ b/Migration.Toolkit.KX13/Models/OmAbvariantDatum.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmAccount.cs b/Migration.Toolkit.KX13/Models/OmAccount.cs index cf011a5f..b213c250 100644 --- a/Migration.Toolkit.KX13/Models/OmAccount.cs +++ b/Migration.Toolkit.KX13/Models/OmAccount.cs @@ -1,114 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmAccountContact.cs b/Migration.Toolkit.KX13/Models/OmAccountContact.cs index 220e09d2..1a858306 100644 --- a/Migration.Toolkit.KX13/Models/OmAccountContact.cs +++ b/Migration.Toolkit.KX13/Models/OmAccountContact.cs @@ -1,39 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmAccountStatus.cs b/Migration.Toolkit.KX13/Models/OmAccountStatus.cs index 0e99498a..b1995d94 100644 --- a/Migration.Toolkit.KX13/Models/OmAccountStatus.cs +++ b/Migration.Toolkit.KX13/Models/OmAccountStatus.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmActivity.cs b/Migration.Toolkit.KX13/Models/OmActivity.cs index d728a86a..7aca43ed 100644 --- a/Migration.Toolkit.KX13/Models/OmActivity.cs +++ b/Migration.Toolkit.KX13/Models/OmActivity.cs @@ -1,75 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.KX13/Models/OmActivityRecalculationQueue.cs index 0e32f39d..ce6b15b7 100644 --- a/Migration.Toolkit.KX13/Models/OmActivityRecalculationQueue.cs +++ b/Migration.Toolkit.KX13/Models/OmActivityRecalculationQueue.cs @@ -1,18 +1,18 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmActivityType.cs b/Migration.Toolkit.KX13/Models/OmActivityType.cs index c2c37544..759716fb 100644 --- a/Migration.Toolkit.KX13/Models/OmActivityType.cs +++ b/Migration.Toolkit.KX13/Models/OmActivityType.cs @@ -1,44 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmContact.cs b/Migration.Toolkit.KX13/Models/OmContact.cs index 84167302..8b8c79a9 100644 --- a/Migration.Toolkit.KX13/Models/OmContact.cs +++ b/Migration.Toolkit.KX13/Models/OmContact.cs @@ -1,141 +1,141 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.KX13/Models/OmContactChangeRecalculationQueue.cs index d93c3371..7bfd6863 100644 --- a/Migration.Toolkit.KX13/Models/OmContactChangeRecalculationQueue.cs +++ b/Migration.Toolkit.KX13/Models/OmContactChangeRecalculationQueue.cs @@ -1,24 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmContactGroup.cs b/Migration.Toolkit.KX13/Models/OmContactGroup.cs index b4e94437..f1585bd6 100644 --- a/Migration.Toolkit.KX13/Models/OmContactGroup.cs +++ b/Migration.Toolkit.KX13/Models/OmContactGroup.cs @@ -1,40 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmContactGroupMember.cs b/Migration.Toolkit.KX13/Models/OmContactGroupMember.cs index 080c31be..0a2b2598 100644 --- a/Migration.Toolkit.KX13/Models/OmContactGroupMember.cs +++ b/Migration.Toolkit.KX13/Models/OmContactGroupMember.cs @@ -1,36 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmContactRole.cs b/Migration.Toolkit.KX13/Models/OmContactRole.cs index 90352149..34952ac2 100644 --- a/Migration.Toolkit.KX13/Models/OmContactRole.cs +++ b/Migration.Toolkit.KX13/Models/OmContactRole.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmContactStatus.cs b/Migration.Toolkit.KX13/Models/OmContactStatus.cs index 7987ec1d..f686cbfd 100644 --- a/Migration.Toolkit.KX13/Models/OmContactStatus.cs +++ b/Migration.Toolkit.KX13/Models/OmContactStatus.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmMembership.cs b/Migration.Toolkit.KX13/Models/OmMembership.cs index 12104b96..eabb61eb 100644 --- a/Migration.Toolkit.KX13/Models/OmMembership.cs +++ b/Migration.Toolkit.KX13/Models/OmMembership.cs @@ -1,34 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmRule.cs b/Migration.Toolkit.KX13/Models/OmRule.cs index 1ef65efc..3062ec58 100644 --- a/Migration.Toolkit.KX13/Models/OmRule.cs +++ b/Migration.Toolkit.KX13/Models/OmRule.cs @@ -1,71 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmScore.cs b/Migration.Toolkit.KX13/Models/OmScore.cs index 430af456..9dc04e76 100644 --- a/Migration.Toolkit.KX13/Models/OmScore.cs +++ b/Migration.Toolkit.KX13/Models/OmScore.cs @@ -1,53 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmScoreContactRule.cs b/Migration.Toolkit.KX13/Models/OmScoreContactRule.cs index 15e7c21c..1a71dbd7 100644 --- a/Migration.Toolkit.KX13/Models/OmScoreContactRule.cs +++ b/Migration.Toolkit.KX13/Models/OmScoreContactRule.cs @@ -1,44 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/OmVisitorToContact.cs b/Migration.Toolkit.KX13/Models/OmVisitorToContact.cs index 07fbc0df..0826fe46 100644 --- a/Migration.Toolkit.KX13/Models/OmVisitorToContact.cs +++ b/Migration.Toolkit.KX13/Models/OmVisitorToContact.cs @@ -1,27 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/PersonasPersona.cs b/Migration.Toolkit.KX13/Models/PersonasPersona.cs index 7738667e..9d878214 100644 --- a/Migration.Toolkit.KX13/Models/PersonasPersona.cs +++ b/Migration.Toolkit.KX13/Models/PersonasPersona.cs @@ -1,40 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/PersonasPersonaContactHistory.cs b/Migration.Toolkit.KX13/Models/PersonasPersonaContactHistory.cs index aeb77551..3526e785 100644 --- a/Migration.Toolkit.KX13/Models/PersonasPersonaContactHistory.cs +++ b/Migration.Toolkit.KX13/Models/PersonasPersonaContactHistory.cs @@ -1,28 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ReportingReport.cs b/Migration.Toolkit.KX13/Models/ReportingReport.cs index 89ca6069..43c0e67d 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReport.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReport.cs @@ -1,62 +1,62 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/ReportingReportCategory.cs b/Migration.Toolkit.KX13/Models/ReportingReportCategory.cs index bac34a92..9f9a64f8 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReportCategory.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReportCategory.cs @@ -1,51 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/ReportingReportGraph.cs b/Migration.Toolkit.KX13/Models/ReportingReportGraph.cs index 14b17bb2..78200727 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReportGraph.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReportGraph.cs @@ -1,69 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/ReportingReportSubscription.cs b/Migration.Toolkit.KX13/Models/ReportingReportSubscription.cs index 89e1aeef..992a5158 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReportSubscription.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReportSubscription.cs @@ -1,93 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ReportingReportTable.cs b/Migration.Toolkit.KX13/Models/ReportingReportTable.cs index f879c73f..083b45aa 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReportTable.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReportTable.cs @@ -1,47 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ReportingReportValue.cs b/Migration.Toolkit.KX13/Models/ReportingReportValue.cs index 0f49e25b..387fdc9d 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReportValue.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReportValue.cs @@ -1,50 +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_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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ReportingSavedGraph.cs b/Migration.Toolkit.KX13/Models/ReportingSavedGraph.cs index 686e5a2f..2573d5a2 100644 --- a/Migration.Toolkit.KX13/Models/ReportingSavedGraph.cs +++ b/Migration.Toolkit.KX13/Models/ReportingSavedGraph.cs @@ -1,34 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ReportingSavedReport.cs b/Migration.Toolkit.KX13/Models/ReportingSavedReport.cs index db8e07eb..f97fbc8f 100644 --- a/Migration.Toolkit.KX13/Models/ReportingSavedReport.cs +++ b/Migration.Toolkit.KX13/Models/ReportingSavedReport.cs @@ -1,48 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/SharePointSharePointConnection.cs b/Migration.Toolkit.KX13/Models/SharePointSharePointConnection.cs index 939164b2..82e54f81 100644 --- a/Migration.Toolkit.KX13/Models/SharePointSharePointConnection.cs +++ b/Migration.Toolkit.KX13/Models/SharePointSharePointConnection.cs @@ -1,46 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/SharePointSharePointFile.cs b/Migration.Toolkit.KX13/Models/SharePointSharePointFile.cs index b7eaa574..3b160e0a 100644 --- a/Migration.Toolkit.KX13/Models/SharePointSharePointFile.cs +++ b/Migration.Toolkit.KX13/Models/SharePointSharePointFile.cs @@ -1,57 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/SharePointSharePointLibrary.cs b/Migration.Toolkit.KX13/Models/SharePointSharePointLibrary.cs index 4e2baa8c..7f2a9b42 100644 --- a/Migration.Toolkit.KX13/Models/SharePointSharePointLibrary.cs +++ b/Migration.Toolkit.KX13/Models/SharePointSharePointLibrary.cs @@ -1,52 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmFacebookAccount.cs b/Migration.Toolkit.KX13/Models/SmFacebookAccount.cs index a8bfd2b9..d3faffd6 100644 --- a/Migration.Toolkit.KX13/Models/SmFacebookAccount.cs +++ b/Migration.Toolkit.KX13/Models/SmFacebookAccount.cs @@ -1,55 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmFacebookApplication.cs b/Migration.Toolkit.KX13/Models/SmFacebookApplication.cs index b041cff9..b2465a85 100644 --- a/Migration.Toolkit.KX13/Models/SmFacebookApplication.cs +++ b/Migration.Toolkit.KX13/Models/SmFacebookApplication.cs @@ -1,43 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmFacebookPost.cs b/Migration.Toolkit.KX13/Models/SmFacebookPost.cs index e02c1161..92f22b7d 100644 --- a/Migration.Toolkit.KX13/Models/SmFacebookPost.cs +++ b/Migration.Toolkit.KX13/Models/SmFacebookPost.cs @@ -1,89 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmInsight.cs b/Migration.Toolkit.KX13/Models/SmInsight.cs index 52e402b3..0a53e679 100644 --- a/Migration.Toolkit.KX13/Models/SmInsight.cs +++ b/Migration.Toolkit.KX13/Models/SmInsight.cs @@ -1,39 +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_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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitDay.cs b/Migration.Toolkit.KX13/Models/SmInsightHitDay.cs index e4cb9a71..f52eb1c6 100644 --- a/Migration.Toolkit.KX13/Models/SmInsightHitDay.cs +++ b/Migration.Toolkit.KX13/Models/SmInsightHitDay.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitMonth.cs b/Migration.Toolkit.KX13/Models/SmInsightHitMonth.cs index d5248893..9245eb05 100644 --- a/Migration.Toolkit.KX13/Models/SmInsightHitMonth.cs +++ b/Migration.Toolkit.KX13/Models/SmInsightHitMonth.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitWeek.cs b/Migration.Toolkit.KX13/Models/SmInsightHitWeek.cs index f85c2e68..511a9b45 100644 --- a/Migration.Toolkit.KX13/Models/SmInsightHitWeek.cs +++ b/Migration.Toolkit.KX13/Models/SmInsightHitWeek.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitYear.cs b/Migration.Toolkit.KX13/Models/SmInsightHitYear.cs index 37d70c50..f60e757f 100644 --- a/Migration.Toolkit.KX13/Models/SmInsightHitYear.cs +++ b/Migration.Toolkit.KX13/Models/SmInsightHitYear.cs @@ -1,29 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmLinkedInAccount.cs b/Migration.Toolkit.KX13/Models/SmLinkedInAccount.cs index 1e79ab4e..82ec9965 100644 --- a/Migration.Toolkit.KX13/Models/SmLinkedInAccount.cs +++ b/Migration.Toolkit.KX13/Models/SmLinkedInAccount.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.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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmLinkedInApplication.cs b/Migration.Toolkit.KX13/Models/SmLinkedInApplication.cs index b427fcdd..1bb160c1 100644 --- a/Migration.Toolkit.KX13/Models/SmLinkedInApplication.cs +++ b/Migration.Toolkit.KX13/Models/SmLinkedInApplication.cs @@ -1,40 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmLinkedInPost.cs b/Migration.Toolkit.KX13/Models/SmLinkedInPost.cs index 5abfef65..c0cec1e7 100644 --- a/Migration.Toolkit.KX13/Models/SmLinkedInPost.cs +++ b/Migration.Toolkit.KX13/Models/SmLinkedInPost.cs @@ -1,85 +1,85 @@ -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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmTwitterAccount.cs b/Migration.Toolkit.KX13/Models/SmTwitterAccount.cs index 7ec5c5f4..4cb1a5f6 100644 --- a/Migration.Toolkit.KX13/Models/SmTwitterAccount.cs +++ b/Migration.Toolkit.KX13/Models/SmTwitterAccount.cs @@ -1,64 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmTwitterApplication.cs b/Migration.Toolkit.KX13/Models/SmTwitterApplication.cs index d9be4720..4c7e1bd5 100644 --- a/Migration.Toolkit.KX13/Models/SmTwitterApplication.cs +++ b/Migration.Toolkit.KX13/Models/SmTwitterApplication.cs @@ -1,43 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/SmTwitterPost.cs b/Migration.Toolkit.KX13/Models/SmTwitterPost.cs index a81785ec..0b24ad50 100644 --- a/Migration.Toolkit.KX13/Models/SmTwitterPost.cs +++ b/Migration.Toolkit.KX13/Models/SmTwitterPost.cs @@ -1,71 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/StagingServer.cs b/Migration.Toolkit.KX13/Models/StagingServer.cs index cf3adfa6..a6a8fc28 100644 --- a/Migration.Toolkit.KX13/Models/StagingServer.cs +++ b/Migration.Toolkit.KX13/Models/StagingServer.cs @@ -1,62 +1,62 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/StagingSynchronization.cs b/Migration.Toolkit.KX13/Models/StagingSynchronization.cs index d8ed9eb7..2fe344e9 100644 --- a/Migration.Toolkit.KX13/Models/StagingSynchronization.cs +++ b/Migration.Toolkit.KX13/Models/StagingSynchronization.cs @@ -1,35 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/StagingTask.cs b/Migration.Toolkit.KX13/Models/StagingTask.cs index ccf277ae..838b2128 100644 --- a/Migration.Toolkit.KX13/Models/StagingTask.cs +++ b/Migration.Toolkit.KX13/Models/StagingTask.cs @@ -1,64 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/StagingTaskGroup.cs b/Migration.Toolkit.KX13/Models/StagingTaskGroup.cs index d8475159..045b77b8 100644 --- a/Migration.Toolkit.KX13/Models/StagingTaskGroup.cs +++ b/Migration.Toolkit.KX13/Models/StagingTaskGroup.cs @@ -1,28 +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("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(); -} +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 diff --git a/Migration.Toolkit.KX13/Models/StagingTaskGroupTask.cs b/Migration.Toolkit.KX13/Models/StagingTaskGroupTask.cs index e80b76f9..502b5585 100644 --- a/Migration.Toolkit.KX13/Models/StagingTaskGroupTask.cs +++ b/Migration.Toolkit.KX13/Models/StagingTaskGroupTask.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/StagingTaskGroupUser.cs b/Migration.Toolkit.KX13/Models/StagingTaskGroupUser.cs index 9db522af..d388fc1e 100644 --- a/Migration.Toolkit.KX13/Models/StagingTaskGroupUser.cs +++ b/Migration.Toolkit.KX13/Models/StagingTaskGroupUser.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/StagingTaskUser.cs b/Migration.Toolkit.KX13/Models/StagingTaskUser.cs index 6c24b726..0a72b280 100644 --- a/Migration.Toolkit.KX13/Models/StagingTaskUser.cs +++ b/Migration.Toolkit.KX13/Models/StagingTaskUser.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/TempFile.cs b/Migration.Toolkit.KX13/Models/TempFile.cs index ade2de63..841a895f 100644 --- a/Migration.Toolkit.KX13/Models/TempFile.cs +++ b/Migration.Toolkit.KX13/Models/TempFile.cs @@ -1,50 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/TempPageBuilderWidget.cs b/Migration.Toolkit.KX13/Models/TempPageBuilderWidget.cs index a49dc484..93dd8e7c 100644 --- a/Migration.Toolkit.KX13/Models/TempPageBuilderWidget.cs +++ b/Migration.Toolkit.KX13/Models/TempPageBuilderWidget.cs @@ -1,23 +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("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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Toolkit.KX13/Models/ViewCmsAclitemItemsAndOperator.cs index 3ed476d2..80d11672 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsAclitemItemsAndOperator.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsAclitemItemsAndOperator.cs @@ -1,42 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs index a6e4c35a..37404d7a 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs @@ -1,122 +1,122 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs index 4978aa6e..b6861204 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs @@ -1,52 +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 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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsRelationshipJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsRelationshipJoined.cs index e63a67fd..30e0281f 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsRelationshipJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsRelationshipJoined.cs @@ -1,57 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsResourceStringJoined.cs index 35b5f878..59f1eed5 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsResourceStringJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsResourceStringJoined.cs @@ -1,44 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsResourceTranslatedJoined.cs index 56b4d43a..192e3c0b 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsResourceTranslatedJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsResourceTranslatedJoined.cs @@ -1,28 +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 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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs index b1814c42..78ccbeee 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs @@ -1,23 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsSiteDocumentCount.cs b/Migration.Toolkit.KX13/Models/ViewCmsSiteDocumentCount.cs index 482bbe61..13af4f92 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsSiteDocumentCount.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsSiteDocumentCount.cs @@ -1,41 +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 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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs index 6c0242fe..4a5df558 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs @@ -1,29 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsTreeJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsTreeJoined.cs index 12fdd6e2..18ce59df 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsTreeJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsTreeJoined.cs @@ -1,171 +1,171 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUser.cs b/Migration.Toolkit.KX13/Models/ViewCmsUser.cs index 08caf34f..7c36dbf8 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUser.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUser.cs @@ -1,174 +1,174 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserDocument.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserDocument.cs index 192af2eb..0c9b5f79 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserDocument.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUserDocument.cs @@ -1,53 +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 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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleJoined.cs index 7f1e9ad6..b1d44246 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleJoined.cs @@ -1,46 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRole.cs index 80329980..18e872a6 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRole.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRole.cs @@ -1,25 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs index 23391968..4a72d538 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs @@ -1,19 +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] -public partial class ViewCmsUserRoleMembershipRoleValidOnlyJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserSettingsRoleJoined.cs index 7dc18cc2..0ab10b50 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserSettingsRoleJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUserSettingsRoleJoined.cs @@ -1,42 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs index eb398414..0986165f 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs @@ -1,68 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs index 10ea38f9..9d3da0ce 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs @@ -1,54 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Toolkit.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs index 2bb8e429..2d18895e 100644 --- a/Migration.Toolkit.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs @@ -1,64 +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 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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewIntegrationTaskJoined.cs b/Migration.Toolkit.KX13/Models/ViewIntegrationTaskJoined.cs index 1b74840f..78969f31 100644 --- a/Migration.Toolkit.KX13/Models/ViewIntegrationTaskJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewIntegrationTaskJoined.cs @@ -1,65 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Toolkit.KX13/Models/ViewMembershipMembershipUserJoined.cs index 2979ae31..2c5ea881 100644 --- a/Migration.Toolkit.KX13/Models/ViewMembershipMembershipUserJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewMembershipMembershipUserJoined.cs @@ -1,31 +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 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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Toolkit.KX13/Models/ViewNewsletterSubscriptionsJoined.cs index b12db405..946551b8 100644 --- a/Migration.Toolkit.KX13/Models/ViewNewsletterSubscriptionsJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewNewsletterSubscriptionsJoined.cs @@ -1,39 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmAccountContactAccountJoined.cs index 21602f3d..c1b7ecc3 100644 --- a/Migration.Toolkit.KX13/Models/ViewOmAccountContactAccountJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewOmAccountContactAccountJoined.cs @@ -1,32 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmAccountContactContactJoined.cs index 2e86c86d..022cfc52 100644 --- a/Migration.Toolkit.KX13/Models/ViewOmAccountContactContactJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewOmAccountContactContactJoined.cs @@ -1,41 +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 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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmAccountJoined.cs index 927d9f03..1228688e 100644 --- a/Migration.Toolkit.KX13/Models/ViewOmAccountJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewOmAccountJoined.cs @@ -1,102 +1,102 @@ -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!; -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs index 22d819c1..8e1a545f 100644 --- a/Migration.Toolkit.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -1,78 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KX13/Models/ViewReportingCategoryReportJoined.cs b/Migration.Toolkit.KX13/Models/ViewReportingCategoryReportJoined.cs index 63d4e6fa..b35920a0 100644 --- a/Migration.Toolkit.KX13/Models/ViewReportingCategoryReportJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewReportingCategoryReportJoined.cs @@ -1,52 +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 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!; -} +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 diff --git a/Migration.Toolkit.KX13/SettingsKeys.cs b/Migration.Toolkit.KX13/SettingsKeys.cs index 83cf8a35..b407d8ef 100644 --- a/Migration.Toolkit.KX13/SettingsKeys.cs +++ b/Migration.Toolkit.KX13/SettingsKeys.cs @@ -1,478 +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"; +// 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 diff --git a/Migration.Toolkit.KXP.Api/Auxiliary/DummyFormFile.cs b/Migration.Toolkit.KXP.Api/Auxiliary/DummyFormFile.cs index be5e7e32..f503c1c3 100644 --- a/Migration.Toolkit.KXP.Api/Auxiliary/DummyFormFile.cs +++ b/Migration.Toolkit.KXP.Api/Auxiliary/DummyFormFile.cs @@ -1,36 +1,36 @@ -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; +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 diff --git a/Migration.Toolkit.KXP.Api/Auxiliary/FormComponents.cs b/Migration.Toolkit.KXP.Api/Auxiliary/FormComponents.cs index 89208f7b..ee925aa0 100644 --- a/Migration.Toolkit.KXP.Api/Auxiliary/FormComponents.cs +++ b/Migration.Toolkit.KXP.Api/Auxiliary/FormComponents.cs @@ -1,146 +1,146 @@ -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 +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 diff --git a/Migration.Toolkit.KXP.Api/DependencyInjectionExtensions.cs b/Migration.Toolkit.KXP.Api/DependencyInjectionExtensions.cs index 14c424db..9d788fc2 100644 --- a/Migration.Toolkit.KXP.Api/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.KXP.Api/DependencyInjectionExtensions.cs @@ -1,26 +1,26 @@ -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; - } +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 diff --git a/Migration.Toolkit.KXP.Api/Enums/UserPrivilegeLevelEnum.cs b/Migration.Toolkit.KXP.Api/Enums/UserPrivilegeLevelEnum.cs index 969c527f..1f2b9583 100644 --- a/Migration.Toolkit.KXP.Api/Enums/UserPrivilegeLevelEnum.cs +++ b/Migration.Toolkit.KXP.Api/Enums/UserPrivilegeLevelEnum.cs @@ -1,20 +1,20 @@ -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, +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 diff --git a/Migration.Toolkit.KXP.Api/KxpApiInitializer.cs b/Migration.Toolkit.KXP.Api/KxpApiInitializer.cs index 5c838f61..3bef3582 100644 --- a/Migration.Toolkit.KXP.Api/KxpApiInitializer.cs +++ b/Migration.Toolkit.KXP.Api/KxpApiInitializer.cs @@ -1,33 +1,33 @@ -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; - } +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 diff --git a/Migration.Toolkit.KXP.Api/KxpClassFacade.cs b/Migration.Toolkit.KXP.Api/KxpClassFacade.cs index 774b3bd0..273e6d16 100644 --- a/Migration.Toolkit.KXP.Api/KxpClassFacade.cs +++ b/Migration.Toolkit.KXP.Api/KxpClassFacade.cs @@ -1,81 +1,81 @@ -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); - } - } - } +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 diff --git a/Migration.Toolkit.KXP.Api/KxpMediaFileFacade.cs b/Migration.Toolkit.KXP.Api/KxpMediaFileFacade.cs index e75df708..607cc3a7 100644 --- a/Migration.Toolkit.KXP.Api/KxpMediaFileFacade.cs +++ b/Migration.Toolkit.KXP.Api/KxpMediaFileFacade.cs @@ -1,86 +1,86 @@ -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; - } +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 diff --git a/Migration.Toolkit.KXP.Api/Services/CmsClass/FieldMigrationService.cs b/Migration.Toolkit.KXP.Api/Services/CmsClass/FieldMigrationService.cs index df84d372..092a70fc 100644 --- a/Migration.Toolkit.KXP.Api/Services/CmsClass/FieldMigrationService.cs +++ b/Migration.Toolkit.KXP.Api/Services/CmsClass/FieldMigrationService.cs @@ -1,85 +1,85 @@ -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; - } +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 diff --git a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs b/Migration.Toolkit.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs index fa5b8a8b..dd30298a 100644 --- a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs +++ b/Migration.Toolkit.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs @@ -1,418 +1,418 @@ -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; - } - } - } - } +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 diff --git a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs b/Migration.Toolkit.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs index d7211ae7..77a63060 100644 --- a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs +++ b/Migration.Toolkit.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs @@ -1,97 +1,97 @@ -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 - ); +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 diff --git a/Migration.Toolkit.KXP.Extensions/LegacyAttachmentHandler.cs b/Migration.Toolkit.KXP.Extensions/LegacyAttachmentHandler.cs index 9ad97d50..165c7f6a 100644 --- a/Migration.Toolkit.KXP.Extensions/LegacyAttachmentHandler.cs +++ b/Migration.Toolkit.KXP.Extensions/LegacyAttachmentHandler.cs @@ -1,101 +1,101 @@ -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 LegacyOriginalPath = "__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(LegacyOriginalPath)?.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(); - } +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 diff --git a/Migration.Toolkit.KXP/Context/KxpContext.cs b/Migration.Toolkit.KXP/Context/KxpContext.cs index d039996d..96732613 100644 --- a/Migration.Toolkit.KXP/Context/KxpContext.cs +++ b/Migration.Toolkit.KXP/Context/KxpContext.cs @@ -1,1323 +1,1323 @@ -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); -} +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 diff --git a/Migration.Toolkit.KXP/DependencyInjectionExtensions.cs b/Migration.Toolkit.KXP/DependencyInjectionExtensions.cs index 1d36905e..843afc84 100644 --- a/Migration.Toolkit.KXP/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.KXP/DependencyInjectionExtensions.cs @@ -1,20 +1,20 @@ -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; - } +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 diff --git a/Migration.Toolkit.KXP/Models/CdMigration.cs b/Migration.Toolkit.KXP/Models/CdMigration.cs index ee85f742..4e4b4861 100644 --- a/Migration.Toolkit.KXP/Models/CdMigration.cs +++ b/Migration.Toolkit.KXP/Models/CdMigration.cs @@ -1,24 +1,24 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CiFileMetadatum.cs b/Migration.Toolkit.KXP/Models/CiFileMetadatum.cs index 09f67497..c5075ed9 100644 --- a/Migration.Toolkit.KXP/Models/CiFileMetadatum.cs +++ b/Migration.Toolkit.KXP/Models/CiFileMetadatum.cs @@ -1,22 +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("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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CiMigration.cs b/Migration.Toolkit.KXP/Models/CiMigration.cs index f1d62dc6..c1fe2006 100644 --- a/Migration.Toolkit.KXP/Models/CiMigration.cs +++ b/Migration.Toolkit.KXP/Models/CiMigration.cs @@ -1,24 +1,24 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsAlternativeForm.cs b/Migration.Toolkit.KXP/Models/CmsAlternativeForm.cs index 6c3ede7e..3cd4effb 100644 --- a/Migration.Toolkit.KXP/Models/CmsAlternativeForm.cs +++ b/Migration.Toolkit.KXP/Models/CmsAlternativeForm.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.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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsApplicationPermission.cs b/Migration.Toolkit.KXP/Models/CmsApplicationPermission.cs index fe5f6af6..ea0ec286 100644 --- a/Migration.Toolkit.KXP/Models/CmsApplicationPermission.cs +++ b/Migration.Toolkit.KXP/Models/CmsApplicationPermission.cs @@ -1,32 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsAutomationHistory.cs b/Migration.Toolkit.KXP/Models/CmsAutomationHistory.cs index 7e468086..04cd7cad 100644 --- a/Migration.Toolkit.KXP/Models/CmsAutomationHistory.cs +++ b/Migration.Toolkit.KXP/Models/CmsAutomationHistory.cs @@ -1,82 +1,82 @@ -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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsAutomationState.cs b/Migration.Toolkit.KXP/Models/CmsAutomationState.cs index 94ef07b1..d6c14c67 100644 --- a/Migration.Toolkit.KXP/Models/CmsAutomationState.cs +++ b/Migration.Toolkit.KXP/Models/CmsAutomationState.cs @@ -1,63 +1,63 @@ -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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsAutomationTemplate.cs b/Migration.Toolkit.KXP/Models/CmsAutomationTemplate.cs index 507bef6a..86188ce8 100644 --- a/Migration.Toolkit.KXP/Models/CmsAutomationTemplate.cs +++ b/Migration.Toolkit.KXP/Models/CmsAutomationTemplate.cs @@ -1,30 +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_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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsChannel.cs b/Migration.Toolkit.KXP/Models/CmsChannel.cs index 639dbbb7..0879584f 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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsClass.cs b/Migration.Toolkit.KXP/Models/CmsClass.cs index e3730e30..06241796 100644 --- a/Migration.Toolkit.KXP/Models/CmsClass.cs +++ b/Migration.Toolkit.KXP/Models/CmsClass.cs @@ -1,97 +1,97 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsConsent.cs b/Migration.Toolkit.KXP/Models/CmsConsent.cs index 25f03f97..c5fba218 100644 --- a/Migration.Toolkit.KXP/Models/CmsConsent.cs +++ b/Migration.Toolkit.KXP/Models/CmsConsent.cs @@ -1,36 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsConsentAgreement.cs b/Migration.Toolkit.KXP/Models/CmsConsentAgreement.cs index ab553316..d166d637 100644 --- a/Migration.Toolkit.KXP/Models/CmsConsentAgreement.cs +++ b/Migration.Toolkit.KXP/Models/CmsConsentAgreement.cs @@ -1,39 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsConsentArchive.cs b/Migration.Toolkit.KXP/Models/CmsConsentArchive.cs index e0e682cf..b08db150 100644 --- a/Migration.Toolkit.KXP/Models/CmsConsentArchive.cs +++ b/Migration.Toolkit.KXP/Models/CmsConsentArchive.cs @@ -1,32 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentFolder.cs b/Migration.Toolkit.KXP/Models/CmsContentFolder.cs index dfb44fcd..01c240e0 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentFolder.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentFolder.cs @@ -1,63 +1,63 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentItem.cs b/Migration.Toolkit.KXP/Models/CmsContentItem.cs index 6af26d35..20e90a0b 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItem.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentItem.cs @@ -1,67 +1,67 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemCommonDatum.cs b/Migration.Toolkit.KXP/Models/CmsContentItemCommonDatum.cs index 33329615..d53caf90 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemCommonDatum.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentItemCommonDatum.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.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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemLanguageMetadatum.cs b/Migration.Toolkit.KXP/Models/CmsContentItemLanguageMetadatum.cs index 3aa7e5e3..817f826f 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemLanguageMetadatum.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentItemLanguageMetadatum.cs @@ -1,73 +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_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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemReference.cs b/Migration.Toolkit.KXP/Models/CmsContentItemReference.cs index 897e7319..5e8a2376 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemReference.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentItemReference.cs @@ -1,38 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemTag.cs b/Migration.Toolkit.KXP/Models/CmsContentItemTag.cs index 908f14cd..2c58da44 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemTag.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentItemTag.cs @@ -1,32 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentLanguage.cs b/Migration.Toolkit.KXP/Models/CmsContentLanguage.cs index d64dbda7..f989d5db 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentLanguage.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentLanguage.cs @@ -1,53 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentTypeChannel.cs b/Migration.Toolkit.KXP/Models/CmsContentTypeChannel.cs index e0e1af5b..84f71fbb 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentTypeChannel.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentTypeChannel.cs @@ -1,31 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflow.cs b/Migration.Toolkit.KXP/Models/CmsContentWorkflow.cs index addb7226..35ef1f99 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflow.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentWorkflow.cs @@ -1,32 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflowContentType.cs b/Migration.Toolkit.KXP/Models/CmsContentWorkflowContentType.cs index 5a6c855b..f197d6d3 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflowContentType.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentWorkflowContentType.cs @@ -1,31 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStep.cs b/Migration.Toolkit.KXP/Models/CmsContentWorkflowStep.cs index cd146a28..c799c952 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStep.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentWorkflowStep.cs @@ -1,48 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStepRole.cs b/Migration.Toolkit.KXP/Models/CmsContentWorkflowStepRole.cs index c7e771ed..22067cc7 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStepRole.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentWorkflowStepRole.cs @@ -1,31 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsCountry.cs b/Migration.Toolkit.KXP/Models/CmsCountry.cs index b3ebadc1..85856650 100644 --- a/Migration.Toolkit.KXP/Models/CmsCountry.cs +++ b/Migration.Toolkit.KXP/Models/CmsCountry.cs @@ -1,41 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsCulture.cs b/Migration.Toolkit.KXP/Models/CmsCulture.cs index dcb0a1ce..b759b91f 100644 --- a/Migration.Toolkit.KXP/Models/CmsCulture.cs +++ b/Migration.Toolkit.KXP/Models/CmsCulture.cs @@ -1,40 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsEmail.cs b/Migration.Toolkit.KXP/Models/CmsEmail.cs index dc77856a..d7d24e8c 100644 --- a/Migration.Toolkit.KXP/Models/CmsEmail.cs +++ b/Migration.Toolkit.KXP/Models/CmsEmail.cs @@ -1,69 +1,69 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsEmailAttachment.cs b/Migration.Toolkit.KXP/Models/CmsEmailAttachment.cs index 45692d88..29e070be 100644 --- a/Migration.Toolkit.KXP/Models/CmsEmailAttachment.cs +++ b/Migration.Toolkit.KXP/Models/CmsEmailAttachment.cs @@ -1,41 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsEventLog.cs b/Migration.Toolkit.KXP/Models/CmsEventLog.cs index 8c9f47e4..2432714b 100644 --- a/Migration.Toolkit.KXP/Models/CmsEventLog.cs +++ b/Migration.Toolkit.KXP/Models/CmsEventLog.cs @@ -1,47 +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_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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsExternalLogin.cs b/Migration.Toolkit.KXP/Models/CmsExternalLogin.cs index a07e5ae5..e1d677dd 100644 --- a/Migration.Toolkit.KXP/Models/CmsExternalLogin.cs +++ b/Migration.Toolkit.KXP/Models/CmsExternalLogin.cs @@ -1,29 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsForm.cs b/Migration.Toolkit.KXP/Models/CmsForm.cs index 7d34600c..cf357f52 100644 --- a/Migration.Toolkit.KXP/Models/CmsForm.cs +++ b/Migration.Toolkit.KXP/Models/CmsForm.cs @@ -1,55 +1,55 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsFormFeaturedField.cs b/Migration.Toolkit.KXP/Models/CmsFormFeaturedField.cs index 8ba15e44..59df3689 100644 --- a/Migration.Toolkit.KXP/Models/CmsFormFeaturedField.cs +++ b/Migration.Toolkit.KXP/Models/CmsFormFeaturedField.cs @@ -1,40 +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_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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsHeadlessChannel.cs b/Migration.Toolkit.KXP/Models/CmsHeadlessChannel.cs index 7e7a2a85..cdb5c697 100644 --- a/Migration.Toolkit.KXP/Models/CmsHeadlessChannel.cs +++ b/Migration.Toolkit.KXP/Models/CmsHeadlessChannel.cs @@ -1,44 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsHeadlessItem.cs b/Migration.Toolkit.KXP/Models/CmsHeadlessItem.cs index b3f0fd0e..22aa8af0 100644 --- a/Migration.Toolkit.KXP/Models/CmsHeadlessItem.cs +++ b/Migration.Toolkit.KXP/Models/CmsHeadlessItem.cs @@ -1,37 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsHeadlessToken.cs b/Migration.Toolkit.KXP/Models/CmsHeadlessToken.cs index 53b3d1f0..0eac3573 100644 --- a/Migration.Toolkit.KXP/Models/CmsHeadlessToken.cs +++ b/Migration.Toolkit.KXP/Models/CmsHeadlessToken.cs @@ -1,59 +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_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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsLicenseKey.cs b/Migration.Toolkit.KXP/Models/CmsLicenseKey.cs index 4ebd60b2..8b97f848 100644 --- a/Migration.Toolkit.KXP/Models/CmsLicenseKey.cs +++ b/Migration.Toolkit.KXP/Models/CmsLicenseKey.cs @@ -1,28 +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_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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsMacroIdentity.cs b/Migration.Toolkit.KXP/Models/CmsMacroIdentity.cs index a671e4dd..3e27aacb 100644 --- a/Migration.Toolkit.KXP/Models/CmsMacroIdentity.cs +++ b/Migration.Toolkit.KXP/Models/CmsMacroIdentity.cs @@ -1,33 +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_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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsMacroRule.cs b/Migration.Toolkit.KXP/Models/CmsMacroRule.cs index 228f24be..982a9aa9 100644 --- a/Migration.Toolkit.KXP/Models/CmsMacroRule.cs +++ b/Migration.Toolkit.KXP/Models/CmsMacroRule.cs @@ -1,43 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsMacroRuleCategory.cs b/Migration.Toolkit.KXP/Models/CmsMacroRuleCategory.cs index bfdecbd8..b328ebb5 100644 --- a/Migration.Toolkit.KXP/Models/CmsMacroRuleCategory.cs +++ b/Migration.Toolkit.KXP/Models/CmsMacroRuleCategory.cs @@ -1,33 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsMacroRuleMacroRuleCategory.cs b/Migration.Toolkit.KXP/Models/CmsMacroRuleMacroRuleCategory.cs index 015cd63f..3bcf619c 100644 --- a/Migration.Toolkit.KXP/Models/CmsMacroRuleMacroRuleCategory.cs +++ b/Migration.Toolkit.KXP/Models/CmsMacroRuleMacroRuleCategory.cs @@ -1,31 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsMember.cs b/Migration.Toolkit.KXP/Models/CmsMember.cs index db5dc2e2..c6037d26 100644 --- a/Migration.Toolkit.KXP/Models/CmsMember.cs +++ b/Migration.Toolkit.KXP/Models/CmsMember.cs @@ -1,35 +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("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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsMemberExternalLogin.cs b/Migration.Toolkit.KXP/Models/CmsMemberExternalLogin.cs index 55837d30..c2b3d245 100644 --- a/Migration.Toolkit.KXP/Models/CmsMemberExternalLogin.cs +++ b/Migration.Toolkit.KXP/Models/CmsMemberExternalLogin.cs @@ -1,26 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.KXP/Models/CmsObjectWorkflowTrigger.cs index 79e43f54..d29e2e45 100644 --- a/Migration.Toolkit.KXP/Models/CmsObjectWorkflowTrigger.cs +++ b/Migration.Toolkit.KXP/Models/CmsObjectWorkflowTrigger.cs @@ -1,46 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsPageTemplateConfiguration.cs b/Migration.Toolkit.KXP/Models/CmsPageTemplateConfiguration.cs index eb38aa5f..7bc6d6c3 100644 --- a/Migration.Toolkit.KXP/Models/CmsPageTemplateConfiguration.cs +++ b/Migration.Toolkit.KXP/Models/CmsPageTemplateConfiguration.cs @@ -1,32 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsQuery.cs b/Migration.Toolkit.KXP/Models/CmsQuery.cs index 78880db7..d1eb246c 100644 --- a/Migration.Toolkit.KXP/Models/CmsQuery.cs +++ b/Migration.Toolkit.KXP/Models/CmsQuery.cs @@ -1,43 +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_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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsResource.cs b/Migration.Toolkit.KXP/Models/CmsResource.cs index b0378b44..8b94979f 100644 --- a/Migration.Toolkit.KXP/Models/CmsResource.cs +++ b/Migration.Toolkit.KXP/Models/CmsResource.cs @@ -1,40 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsResourceString.cs b/Migration.Toolkit.KXP/Models/CmsResourceString.cs index 659f2a76..2c34cc26 100644 --- a/Migration.Toolkit.KXP/Models/CmsResourceString.cs +++ b/Migration.Toolkit.KXP/Models/CmsResourceString.cs @@ -1,27 +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; - -[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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsResourceTranslation.cs b/Migration.Toolkit.KXP/Models/CmsResourceTranslation.cs index 3d1d5d2b..e8f53d59 100644 --- a/Migration.Toolkit.KXP/Models/CmsResourceTranslation.cs +++ b/Migration.Toolkit.KXP/Models/CmsResourceTranslation.cs @@ -1,33 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsRole.cs b/Migration.Toolkit.KXP/Models/CmsRole.cs index bbe881ac..37a750d6 100644 --- a/Migration.Toolkit.KXP/Models/CmsRole.cs +++ b/Migration.Toolkit.KXP/Models/CmsRole.cs @@ -1,41 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsScheduledTask.cs b/Migration.Toolkit.KXP/Models/CmsScheduledTask.cs index e092b14b..bff6fcc1 100644 --- a/Migration.Toolkit.KXP/Models/CmsScheduledTask.cs +++ b/Migration.Toolkit.KXP/Models/CmsScheduledTask.cs @@ -1,74 +1,74 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsSettingsCategory.cs b/Migration.Toolkit.KXP/Models/CmsSettingsCategory.cs index 85b6a681..dd8ad9c9 100644 --- a/Migration.Toolkit.KXP/Models/CmsSettingsCategory.cs +++ b/Migration.Toolkit.KXP/Models/CmsSettingsCategory.cs @@ -1,60 +1,60 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsSettingsKey.cs b/Migration.Toolkit.KXP/Models/CmsSettingsKey.cs index 1b67281a..46d98081 100644 --- a/Migration.Toolkit.KXP/Models/CmsSettingsKey.cs +++ b/Migration.Toolkit.KXP/Models/CmsSettingsKey.cs @@ -1,58 +1,58 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsState.cs b/Migration.Toolkit.KXP/Models/CmsState.cs index 18585da2..38f2e33d 100644 --- a/Migration.Toolkit.KXP/Models/CmsState.cs +++ b/Migration.Toolkit.KXP/Models/CmsState.cs @@ -1,44 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsTag.cs b/Migration.Toolkit.KXP/Models/CmsTag.cs index e8fd16ec..f78f7f4c 100644 --- a/Migration.Toolkit.KXP/Models/CmsTag.cs +++ b/Migration.Toolkit.KXP/Models/CmsTag.cs @@ -1,52 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsTaxonomy.cs b/Migration.Toolkit.KXP/Models/CmsTaxonomy.cs index 637e28dc..221686cd 100644 --- a/Migration.Toolkit.KXP/Models/CmsTaxonomy.cs +++ b/Migration.Toolkit.KXP/Models/CmsTaxonomy.cs @@ -1,34 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsUser.cs b/Migration.Toolkit.KXP/Models/CmsUser.cs index f6207605..a35ee1e4 100644 --- a/Migration.Toolkit.KXP/Models/CmsUser.cs +++ b/Migration.Toolkit.KXP/Models/CmsUser.cs @@ -1,107 +1,107 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.KXP/Models/CmsUserMacroIdentity.cs index 4c687b58..39d229f1 100644 --- a/Migration.Toolkit.KXP/Models/CmsUserMacroIdentity.cs +++ b/Migration.Toolkit.KXP/Models/CmsUserMacroIdentity.cs @@ -1,35 +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("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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsUserRole.cs b/Migration.Toolkit.KXP/Models/CmsUserRole.cs index 7caad12e..b03a8e66 100644 --- a/Migration.Toolkit.KXP/Models/CmsUserRole.cs +++ b/Migration.Toolkit.KXP/Models/CmsUserRole.cs @@ -1,31 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServer.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServer.cs index 1fd9fb69..ff85e4b7 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServer.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebFarmServer.cs @@ -1,32 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServerLog.cs index 38dc0fe5..28862381 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServerLog.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebFarmServerLog.cs @@ -1,23 +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("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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServerMonitoring.cs index cb80d7ef..2fb37037 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServerMonitoring.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebFarmServerMonitoring.cs @@ -1,20 +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_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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServerTask.cs index 293dd401..2a901693 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServerTask.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebFarmServerTask.cs @@ -1,31 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmTask.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmTask.cs index 26890f28..2cac07b3 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmTask.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebFarmTask.cs @@ -1,42 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWebPageFormerUrlPath.cs b/Migration.Toolkit.KXP/Models/CmsWebPageFormerUrlPath.cs index 40cfa00a..1591ccb9 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebPageFormerUrlPath.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebPageFormerUrlPath.cs @@ -1,47 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWebPageItem.cs b/Migration.Toolkit.KXP/Models/CmsWebPageItem.cs index 23c15799..576bfc46 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebPageItem.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebPageItem.cs @@ -1,62 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWebPageUrlPath.cs b/Migration.Toolkit.KXP/Models/CmsWebPageUrlPath.cs index 7bb3252b..b396f9c3 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebPageUrlPath.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebPageUrlPath.cs @@ -1,54 +1,54 @@ -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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWebsiteCaptchaSetting.cs b/Migration.Toolkit.KXP/Models/CmsWebsiteCaptchaSetting.cs index ee709449..7f9ab1e2 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebsiteCaptchaSetting.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebsiteCaptchaSetting.cs @@ -1,31 +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_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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWebsiteChannel.cs b/Migration.Toolkit.KXP/Models/CmsWebsiteChannel.cs index d207180f..3766c661 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebsiteChannel.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebsiteChannel.cs @@ -1,54 +1,54 @@ -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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflow.cs b/Migration.Toolkit.KXP/Models/CmsWorkflow.cs index 6741c8f6..584e7433 100644 --- a/Migration.Toolkit.KXP/Models/CmsWorkflow.cs +++ b/Migration.Toolkit.KXP/Models/CmsWorkflow.cs @@ -1,83 +1,83 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflowAction.cs b/Migration.Toolkit.KXP/Models/CmsWorkflowAction.cs index 749e947c..c4a4afe2 100644 --- a/Migration.Toolkit.KXP/Models/CmsWorkflowAction.cs +++ b/Migration.Toolkit.KXP/Models/CmsWorkflowAction.cs @@ -1,66 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflowStep.cs b/Migration.Toolkit.KXP/Models/CmsWorkflowStep.cs index 51b8c6f7..18aac65c 100644 --- a/Migration.Toolkit.KXP/Models/CmsWorkflowStep.cs +++ b/Migration.Toolkit.KXP/Models/CmsWorkflowStep.cs @@ -1,94 +1,94 @@ -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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.KXP/Models/CmsWorkflowTransition.cs index 1e23cf55..c9caaaed 100644 --- a/Migration.Toolkit.KXP/Models/CmsWorkflowTransition.cs +++ b/Migration.Toolkit.KXP/Models/CmsWorkflowTransition.cs @@ -1,46 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailBounce.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailBounce.cs index b0ea1e16..00d56fb2 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailBounce.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailBounce.cs @@ -1,23 +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("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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannel.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannel.cs index c439c865..46ac24c6 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannel.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannel.cs @@ -1,41 +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("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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannelSender.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannelSender.cs index 93a5ebf3..24da3132 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannelSender.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannelSender.cs @@ -1,34 +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("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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailConfiguration.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailConfiguration.cs index 41619fa3..42d65da5 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailConfiguration.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailConfiguration.cs @@ -1,60 +1,60 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailLink.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailLink.cs index 1384605c..5ddafc2e 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailLink.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailLink.cs @@ -1,34 +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("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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailMarketingRecipient.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailMarketingRecipient.cs index 86a00fa0..7ccc4e48 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailMarketingRecipient.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailMarketingRecipient.cs @@ -1,43 +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("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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatistic.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatistic.cs index c2a2b659..cbae7b82 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatistic.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatistic.cs @@ -1,43 +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("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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatisticsHit.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatisticsHit.cs index 08d28e20..8bd2fa7b 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatisticsHit.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatisticsHit.cs @@ -1,38 +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_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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs index 01d9712d..b1fde4e5 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs @@ -1,38 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplate.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplate.cs index edcf8450..9d3c1d0c 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplate.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplate.cs @@ -1,32 +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("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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplateContentType.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplateContentType.cs index 0f415804..d4a4eec7 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplateContentType.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplateContentType.cs @@ -1,31 +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("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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryRecipientListSetting.cs b/Migration.Toolkit.KXP/Models/EmailLibraryRecipientListSetting.cs index a4e53a27..1df1e79d 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryRecipientListSetting.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryRecipientListSetting.cs @@ -1,40 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/EmailLibrarySendConfiguration.cs b/Migration.Toolkit.KXP/Models/EmailLibrarySendConfiguration.cs index 72d711db..85f2e3b6 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibrarySendConfiguration.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibrarySendConfiguration.cs @@ -1,39 +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_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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/MediaFile.cs b/Migration.Toolkit.KXP/Models/MediaFile.cs index 2c569a3b..eccd2aa7 100644 --- a/Migration.Toolkit.KXP/Models/MediaFile.cs +++ b/Migration.Toolkit.KXP/Models/MediaFile.cs @@ -1,71 +1,71 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/MediaLibrary.cs b/Migration.Toolkit.KXP/Models/MediaLibrary.cs index c6877376..f65d2f29 100644 --- a/Migration.Toolkit.KXP/Models/MediaLibrary.cs +++ b/Migration.Toolkit.KXP/Models/MediaLibrary.cs @@ -1,37 +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("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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmAccount.cs b/Migration.Toolkit.KXP/Models/OmAccount.cs index 96ebd69c..e67e0195 100644 --- a/Migration.Toolkit.KXP/Models/OmAccount.cs +++ b/Migration.Toolkit.KXP/Models/OmAccount.cs @@ -1,114 +1,114 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmAccountContact.cs b/Migration.Toolkit.KXP/Models/OmAccountContact.cs index f106c520..7d694bc8 100644 --- a/Migration.Toolkit.KXP/Models/OmAccountContact.cs +++ b/Migration.Toolkit.KXP/Models/OmAccountContact.cs @@ -1,39 +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("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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmAccountStatus.cs b/Migration.Toolkit.KXP/Models/OmAccountStatus.cs index ce39715f..fdd34cee 100644 --- a/Migration.Toolkit.KXP/Models/OmAccountStatus.cs +++ b/Migration.Toolkit.KXP/Models/OmAccountStatus.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmActivity.cs b/Migration.Toolkit.KXP/Models/OmActivity.cs index bfd07ea3..a3b53cf0 100644 --- a/Migration.Toolkit.KXP/Models/OmActivity.cs +++ b/Migration.Toolkit.KXP/Models/OmActivity.cs @@ -1,77 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.KXP/Models/OmActivityRecalculationQueue.cs index 9688ae05..26eb379d 100644 --- a/Migration.Toolkit.KXP/Models/OmActivityRecalculationQueue.cs +++ b/Migration.Toolkit.KXP/Models/OmActivityRecalculationQueue.cs @@ -1,18 +1,18 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmActivityType.cs b/Migration.Toolkit.KXP/Models/OmActivityType.cs index d3217d77..994a9827 100644 --- a/Migration.Toolkit.KXP/Models/OmActivityType.cs +++ b/Migration.Toolkit.KXP/Models/OmActivityType.cs @@ -1,44 +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("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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmContact.cs b/Migration.Toolkit.KXP/Models/OmContact.cs index d7d20b68..6872dcfe 100644 --- a/Migration.Toolkit.KXP/Models/OmContact.cs +++ b/Migration.Toolkit.KXP/Models/OmContact.cs @@ -1,137 +1,137 @@ -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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.KXP/Models/OmContactChangeRecalculationQueue.cs index bfb6308b..85c047a9 100644 --- a/Migration.Toolkit.KXP/Models/OmContactChangeRecalculationQueue.cs +++ b/Migration.Toolkit.KXP/Models/OmContactChangeRecalculationQueue.cs @@ -1,24 +1,24 @@ -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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmContactGroup.cs b/Migration.Toolkit.KXP/Models/OmContactGroup.cs index 7602c4a6..1c3b416b 100644 --- a/Migration.Toolkit.KXP/Models/OmContactGroup.cs +++ b/Migration.Toolkit.KXP/Models/OmContactGroup.cs @@ -1,48 +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("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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmContactGroupMember.cs b/Migration.Toolkit.KXP/Models/OmContactGroupMember.cs index f0dcc495..a32a9ffa 100644 --- a/Migration.Toolkit.KXP/Models/OmContactGroupMember.cs +++ b/Migration.Toolkit.KXP/Models/OmContactGroupMember.cs @@ -1,36 +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("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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmContactRole.cs b/Migration.Toolkit.KXP/Models/OmContactRole.cs index b25d9897..b9dc2a6c 100644 --- a/Migration.Toolkit.KXP/Models/OmContactRole.cs +++ b/Migration.Toolkit.KXP/Models/OmContactRole.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmContactStatus.cs b/Migration.Toolkit.KXP/Models/OmContactStatus.cs index a24d365e..05d8ad6f 100644 --- a/Migration.Toolkit.KXP/Models/OmContactStatus.cs +++ b/Migration.Toolkit.KXP/Models/OmContactStatus.cs @@ -1,26 +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_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(); -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmTrackedWebsite.cs b/Migration.Toolkit.KXP/Models/OmTrackedWebsite.cs index 93e572d7..5ac33451 100644 --- a/Migration.Toolkit.KXP/Models/OmTrackedWebsite.cs +++ b/Migration.Toolkit.KXP/Models/OmTrackedWebsite.cs @@ -1,37 +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("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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/OmVisitorToContact.cs b/Migration.Toolkit.KXP/Models/OmVisitorToContact.cs index e1daa40a..91c1ac8a 100644 --- a/Migration.Toolkit.KXP/Models/OmVisitorToContact.cs +++ b/Migration.Toolkit.KXP/Models/OmVisitorToContact.cs @@ -1,27 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/TempFile.cs b/Migration.Toolkit.KXP/Models/TempFile.cs index 4002e8f5..52f779cc 100644 --- a/Migration.Toolkit.KXP/Models/TempFile.cs +++ b/Migration.Toolkit.KXP/Models/TempFile.cs @@ -1,50 +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("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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/TempPageBuilderWidget.cs b/Migration.Toolkit.KXP/Models/TempPageBuilderWidget.cs index acb6ea78..645dc1dc 100644 --- a/Migration.Toolkit.KXP/Models/TempPageBuilderWidget.cs +++ b/Migration.Toolkit.KXP/Models/TempPageBuilderWidget.cs @@ -1,23 +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("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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.KXP/Models/ViewCmsResourceStringJoined.cs index 7da37c81..d584553e 100644 --- a/Migration.Toolkit.KXP/Models/ViewCmsResourceStringJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewCmsResourceStringJoined.cs @@ -1,44 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.KXP/Models/ViewCmsResourceTranslatedJoined.cs index 13ffc0c5..a1d06f4a 100644 --- a/Migration.Toolkit.KXP/Models/ViewCmsResourceTranslatedJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewCmsResourceTranslatedJoined.cs @@ -1,28 +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; - -[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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmAccountContactAccountJoined.cs index 5eaa4a96..d24fca9b 100644 --- a/Migration.Toolkit.KXP/Models/ViewOmAccountContactAccountJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewOmAccountContactAccountJoined.cs @@ -1,32 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmAccountContactContactJoined.cs index b555577d..b47bcb04 100644 --- a/Migration.Toolkit.KXP/Models/ViewOmAccountContactContactJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewOmAccountContactContactJoined.cs @@ -1,41 +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; - -[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; } -} +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 diff --git a/Migration.Toolkit.KXP/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmAccountJoined.cs index 8800cb73..5065c083 100644 --- a/Migration.Toolkit.KXP/Models/ViewOmAccountJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewOmAccountJoined.cs @@ -1,102 +1,102 @@ -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!; -} +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 diff --git a/Migration.Toolkit.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs index 9ffdf55d..c11a65ec 100644 --- a/Migration.Toolkit.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -1,78 +1,78 @@ -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; } -} +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 diff --git a/Migration.Toolkit.TestConsole/ConfigurationValidator.cs b/Migration.Toolkit.TestConsole/ConfigurationValidator.cs index 0b45cb42..62f77147 100644 --- a/Migration.Toolkit.TestConsole/ConfigurationValidator.cs +++ b/Migration.Toolkit.TestConsole/ConfigurationValidator.cs @@ -1,102 +1,102 @@ -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 +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 index ae7954b4..4f2f941e 100644 --- a/Migration.Toolkit.TestConsole/ConsoleHelper.cs +++ b/Migration.Toolkit.TestConsole/ConsoleHelper.cs @@ -1,27 +1,27 @@ -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); - } +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 index f0fb70e0..bd8beb46 100644 --- a/Migration.Toolkit.TestConsole/DocumentPageBuilderWidgetsModel.cs +++ b/Migration.Toolkit.TestConsole/DocumentPageBuilderWidgetsModel.cs @@ -1,188 +1,187 @@ -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 - +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 index 506c6a65..5d7ce75e 100644 --- a/Migration.Toolkit.TestConsole/GenHelper.cs +++ b/Migration.Toolkit.TestConsole/GenHelper.cs @@ -1,21 +1,21 @@ -// 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))}|"); -// } -// } -// } +// 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/Program.cs b/Migration.Toolkit.TestConsole/Program.cs index 90e93c45..ff8506ad 100644 --- a/Migration.Toolkit.TestConsole/Program.cs +++ b/Migration.Toolkit.TestConsole/Program.cs @@ -1,168 +1,168 @@ -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(); +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.Tests/MediaHelperTest.cs b/Migration.Toolkit.Tests/MediaHelperTest.cs index 8c91b4f3..9d306f49 100644 --- a/Migration.Toolkit.Tests/MediaHelperTest.cs +++ b/Migration.Toolkit.Tests/MediaHelperTest.cs @@ -1,62 +1,63 @@ -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); - } +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