src/Misc/EFTools/EntityDesignModel/Commands/CreateEntityTypeCommand.cs
/// <summary>
///     This helper function creates a new entity in the conceptual model that is derived from the
///     passed in entity.
///     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>
/// <param name="name">The name of the new, derived entity</param>
/// <param name="baseType">The entity that this new type should derive from</param>
/// <param name="uniquifyName">Flag whether the name should be checked for uniqueness and then changed as required</param>
/// <returns>The new EntityType</returns>
This helper function creates a new entity in the conceptual model that is derived from the
passed in entity.
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 creates a new entity in the conceptual model that is derived from the passed in entity . 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 ConceptualEntityType CreateDerivedEntityType(
            CommandProcessorContext cpc, string name, ConceptualEntityType baseType, bool uniquifyName)
        {
            var cet = new CreateEntityTypeCommand(name, uniquifyName);
            var inh = new CreateInheritanceCommand(cet, baseType);
            var cp = new CommandProcessor(cpc, cet, inh);
            cp.Invoke();
            var derivedType = cet.EntityType as ConceptualEntityType;
            Debug.Assert(derivedType != null, "EntityType is not ConceptualEntityType");
            return derivedType;
        }
internal static ConceptualEntityType CreateDerivedEntityType ( CommandProcessorContext cpc , string name , ConceptualEntityType baseType , bool uniquifyName ) { var cet = new CreateEntityTypeCommand ( name , uniquifyName ) ; var inh = new CreateInheritanceCommand ( cet , baseType ) ; var cp = new CommandProcessor ( cpc , cet , inh ) ; cp . Invoke ( ) ; var derivedType = cet . EntityType as ConceptualEntityType ; Debug . Assert ( derivedType != null , " " ) ; return derivedType ; }
This helper function creates a new entity in the conceptual model that is derived from the
passed in entity.
This helper function creates a new entity in the conceptual model that is derived from the passed in entity .
The new EntityType
The new EntityType
cpc
CommandProcessorContext
None
name
string
The name of the new, derived entity
The name of the new derived entity
baseType
ConceptualEntityType
The entity that this new type should derive from
The entity that this new type should derive from
uniquifyName
bool
Flag whether the name should be checked for uniqueness and then changed as required
Flag whether the name should be checked for uniqueness and then changed as required