src/Misc/EFTools/EntityDesignModel/Commands/UpdateConceptualAndMappingModelsCommand.cs
/// <summary>
///     Helper method to log the VS warning message given the principal and dependent properties
///     for which we could not find matches in the existing artifact
/// </summary>
Helper method to log the VS warning message given the principal and dependent properties
for which we could not find matches in the existing artifact
Helper method to log the VS warning message given the principal and dependent properties for which we could not find matches in the existing artifact
private static void LogWarningMessageForReferentialConstraintProperties(
            string associationName,
            EntityType principalEntityType, EntityType dependentEntityType, List<string> unfoundPrincipalProperties,
            List<string> unfoundDependentProperties)
        {
            if (unfoundDependentProperties.Count > 0
                || unfoundPrincipalProperties.Count > 0)
            {
                var propertyList = new StringBuilder();
                var isFirst = true;
                foreach (var p in unfoundPrincipalProperties)
                {
                    if (false == isFirst)
                    {
                        propertyList.Append(Resources.SeparatorCharacterForMultipleItemsInAnErrorMessage);
                    }
                    propertyList.Append(p);
                    isFirst = false;
                }
                foreach (var p in unfoundDependentProperties)
                {
                    if (false == isFirst)
                    {
                        propertyList.Append(Resources.SeparatorCharacterForMultipleItemsInAnErrorMessage);
                    }
                    propertyList.Append(p);
                    isFirst = false;
                }
                var prinicpalEntityTypeName = principalEntityType.LocalName.Value;
                var dependentEntityTypeName = dependentEntityType.LocalName.Value;
                var s = String.Format(
                    CultureInfo.CurrentCulture, Resources.UpdateFromDatabaseUnableToBringRefConstraint, associationName,
                    prinicpalEntityTypeName, dependentEntityTypeName, propertyList);
                var errorMessageTarget = unfoundPrincipalProperties.Count > 0 ? principalEntityType : dependentEntityType;
                var errorInfo = new ErrorInfo(
                    ErrorInfo.Severity.WARNING, s, errorMessageTarget, ErrorCodes.UPDATE_MODEL_FROM_DB_CANT_INCLUDE_REF_CONSTRAINT,
                    ErrorClass.Escher_UpdateModelFromDB);
                HostContext.Instance.LogUpdateModelWizardError(errorInfo, errorMessageTarget.Uri.LocalPath);
            }
        }
private static void LogWarningMessageForReferentialConstraintProperties ( string associationName , EntityType principalEntityType , EntityType dependentEntityType , List < string > unfoundPrincipalProperties , List < string > unfoundDependentProperties ) { if ( unfoundDependentProperties . Count > 0 || unfoundPrincipalProperties . Count > 0 ) { var propertyList = new StringBuilder ( ) ; var isFirst = true ; foreach ( var p in unfoundPrincipalProperties ) { if ( false == isFirst ) { propertyList . Append ( Resources . SeparatorCharacterForMultipleItemsInAnErrorMessage ) ; } propertyList . Append ( p ) ; isFirst = false ; } foreach ( var p in unfoundDependentProperties ) { if ( false == isFirst ) { propertyList . Append ( Resources . SeparatorCharacterForMultipleItemsInAnErrorMessage ) ; } propertyList . Append ( p ) ; isFirst = false ; } var prinicpalEntityTypeName = principalEntityType . LocalName . Value ; var dependentEntityTypeName = dependentEntityType . LocalName . Value ; var s = String . Format ( CultureInfo . CurrentCulture , Resources . UpdateFromDatabaseUnableToBringRefConstraint , associationName , prinicpalEntityTypeName , dependentEntityTypeName , propertyList ) ; var errorMessageTarget = unfoundPrincipalProperties . Count > 0 ? principalEntityType : dependentEntityType ; var errorInfo = new ErrorInfo ( ErrorInfo . Severity . WARNING , s , errorMessageTarget , ErrorCodes . UPDATE_MODEL_FROM_DB_CANT_INCLUDE_REF_CONSTRAINT , ErrorClass . Escher_UpdateModelFromDB ) ; HostContext . Instance . LogUpdateModelWizardError ( errorInfo , errorMessageTarget . Uri . LocalPath ) ; } }
Helper method to log the VS warning message given the principal and dependent properties
for which we could not find matches in the existing artifact
Helper method to log the VS warning message given the principal and dependent properties for which we could not find matches in the existing artifact
// log a warning to the VS error list.
associationName
string
principalEntityType
EntityType
dependentEntityType
EntityType
unfoundPrincipalProperties
List<string>
unfoundDependentProperties
List<string>