src/Misc/EFTools/EntityDesignModel/Commands/CreateComplexTypeCommand.cs
/// <summary>
///     This helper function will create a complex type using default name.
///     NOTE: If the cpc already has an active transaction, these changes will be in that transaction
///     and the caller of this helper method must commit it to see these changes commited.
/// </summary>
/// <param name="cpc"></param>
/// <returns>The new ComplexType</returns>
This helper function will create a complex type using default name.
NOTE: If the cpc already has an active transaction, these changes will be in that transaction
and the caller of this helper method must commit it to see these changes commited.
This helper function will create a complex type using default name . NOTE : If the cpc already has an active transaction these changes will be in that transaction and the caller of this helper method must commit it to see these changes commited .
internal static ComplexType CreateComplexTypeWithDefaultName(CommandProcessorContext cpc)
        {
            var service = cpc.EditingContext.GetEFArtifactService();
            var artifact = service.Artifact;
            var model = artifact.ConceptualModel();
            if (model == null)
            {
                throw new CannotLocateParentItemException();
            }
            var complexTypeName = ModelHelper.GetUniqueNameWithNumber(typeof(ComplexType), model, Resources.Model_DefaultComplexTypeName);
            var cp = new CommandProcessor(cpc);
            var cmd = new CreateComplexTypeCommand(complexTypeName, false);
            cp.EnqueueCommand(cmd);
            cp.Invoke();
            return cmd.ComplexType;
        }
internal static ComplexType CreateComplexTypeWithDefaultName ( CommandProcessorContext cpc ) { var service = cpc . EditingContext . GetEFArtifactService ( ) ; var artifact = service . Artifact ; var model = artifact . ConceptualModel ( ) ; if ( model == null ) { throw new CannotLocateParentItemException ( ) ; } var complexTypeName = ModelHelper . GetUniqueNameWithNumber ( typeof ( ComplexType ) , model , Resources . Model_DefaultComplexTypeName ) ; var cp = new CommandProcessor ( cpc ) ; var cmd = new CreateComplexTypeCommand ( complexTypeName , false ) ; cp . EnqueueCommand ( cmd ) ; cp . Invoke ( ) ; return cmd . ComplexType ; }
This helper function will create a complex type using default name.
This helper function will create a complex type using default name .
// the model that we want to add the complex type to // go create it
The new ComplexType
The new ComplexType
cpc
CommandProcessorContext
None