src/Misc/EFTools/EntityDesignModel/Commands/CreateEntityTypeCommand.cs
/// <summary>
///     This helper function is an easy way to get a new entity type, entity set and key property in the
///     new entity type created in the conceptual model.
///     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 entity</param>
/// <param name="setName">The name of the new set</param>
/// <param name="createKeyProperty">A flag whether to create a new key property or not (sending false creates no new property)</param>
/// <param name="propertyName">The name of the new property</param>
/// <param name="propertyType">The type of the new property</param>
/// <param name="uniquifyName">Flag whether the name should be checked for uniqueness and then changed as required</param>
/// <param name="isDefaultName">Flag whether the name is the default for new entity types/sets</param>
/// <returns>The new EntityType</returns>
This helper function is an easy way to get a new entity type, entity set and key property in the
new entity type created in the conceptual model.
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 is an easy way to get a new entity type entity set and key property in the new entity type created in the conceptual model . 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 .
[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
        internal static ConceptualEntityType CreateConceptualEntityTypeAndEntitySetAndProperty(
            CommandProcessorContext cpc,
            string name, string setName, bool createKeyProperty, string propertyName,
            string propertyType, string propertyStoreGeneratedPattern, bool uniquifyNames, bool isDefaultName = false)
        {
            var cet = CreateEntityTypeAndEntitySetAndProperty(
                cpc, name, setName, createKeyProperty,
                propertyName, propertyType, propertyStoreGeneratedPattern, ModelSpace.Conceptual, uniquifyNames, isDefaultName) as
                      ConceptualEntityType;
            Debug.Assert(cet != null, "EntityType is not ConceptualEntityType");
            return cet;
        }
[ SuppressMessage ( " " , " " ) ] internal static ConceptualEntityType CreateConceptualEntityTypeAndEntitySetAndProperty ( CommandProcessorContext cpc , string name , string setName , bool createKeyProperty , string propertyName , string propertyType , string propertyStoreGeneratedPattern , bool uniquifyNames , bool isDefaultName = false ) { var cet = CreateEntityTypeAndEntitySetAndProperty ( cpc , name , setName , createKeyProperty , propertyName , propertyType , propertyStoreGeneratedPattern , ModelSpace . Conceptual , uniquifyNames , isDefaultName ) as ConceptualEntityType ; Debug . Assert ( cet != null , " " ) ; return cet ; }
This helper function is an easy way to get a new entity type, entity set and key property in the
new entity type created in the conceptual model.
This helper function is an easy way to get a new entity type entity set and key property in the new entity type created in the conceptual model .
The new EntityType
The new EntityType
cpc
CommandProcessorContext
None
name
string
The name of the new entity
The name of the new entity
setName
string
The name of the new set
The name of the new set
createKeyProperty
bool
A flag whether to create a new key property or not (sending false creates no new property)
A flag whether to create a new key property or not ( sending false creates no new property )
propertyName
string
The name of the new property
The name of the new property
propertyType
string
The type of the new property
The type of the new property
propertyStoreGeneratedPattern
string
uniquifyNames
bool
isDefaultName
bool
Flag whether the name is the default for new entity types/sets
Flag whether the name is the default for new entity types / sets
uniquifyName
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