src/Misc/EFTools/EntityDesignModel/Commands/CreateMatchingFunctionImportCommand.cs
/// <summary>
///     Add a list of commands to create a ComplexType matching the list of columns passed in.
///     Return the initial CreateComplexTypeCommand.
/// </summary>
/// <param name="sModel"></param>
/// <param name="complexTypeName"></param>
/// <param name="columns"></param>
/// <param name="commands"></param>
Add a list of commands to create a ComplexType matching the list of columns passed in.
Return the initial CreateComplexTypeCommand.
Add a list of commands to create a ComplexType matching the list of columns passed in . Return the initial CreateComplexTypeCommand .
internal static CreateComplexTypeCommand AddCreateComplexTypeCommands(
            StorageEntityModel sModel, string complexTypeName, IList<IRawDataSchemaColumn> columns, IList<Command> commands)
        {
            Debug.Assert(false == String.IsNullOrEmpty(complexTypeName), "The passed in complexTypeName is null or empty");
            Debug.Assert(null != columns, "The passed in schema columns are null");
            Debug.Assert(null != commands, "We require a pre-created list of commands to add to");
            CreateComplexTypeCommand cmdNewComplexType = null;
            if (!string.IsNullOrEmpty(complexTypeName)
                && null != columns
                && null != commands)
            {
                cmdNewComplexType = new CreateComplexTypeCommand(complexTypeName, true);
                commands.Add(cmdNewComplexType);
                foreach (var column in columns)
                {
                    AddCreateComplexTypePropertyCommands(sModel, column, cmdNewComplexType, null, commands);
                }
            }
            return cmdNewComplexType;
        }
internal static CreateComplexTypeCommand AddCreateComplexTypeCommands ( StorageEntityModel sModel , string complexTypeName , IList < IRawDataSchemaColumn > columns , IList < Command > commands ) { Debug . Assert ( false == String . IsNullOrEmpty ( complexTypeName ) , " " ) ; Debug . Assert ( null != columns , " " ) ; Debug . Assert ( null != commands , " " ) ; CreateComplexTypeCommand cmdNewComplexType = null ; if ( ! string . IsNullOrEmpty ( complexTypeName ) && null != columns && null != commands ) { cmdNewComplexType = new CreateComplexTypeCommand ( complexTypeName , true ) ; commands . Add ( cmdNewComplexType ) ; foreach ( var column in columns ) { AddCreateComplexTypePropertyCommands ( sModel , column , cmdNewComplexType , null , commands ) ; } } return cmdNewComplexType ; }
Add a list of commands to create a ComplexType matching the list of columns passed in.
Add a list of commands to create a ComplexType matching the list of columns passed in .
// now add commands to add appropriate properties to the ComplexType // adds commands to create and set the facets for a new complex type property to match the column
sModel
StorageEntityModel
None
complexTypeName
string
None
columns
IList<IRawDataSchemaColumn>
None
commands
IList<Command>
None