src/Misc/EFTools/EntityDesignModel/Commands/CreateEnumTypeCommand.cs
/// <summary>
///     This helper function will create an Enum 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 committed.
/// </summary>
/// <param name="cpc"></param>
/// <returns>The new EnumType</returns>
This helper function will create an Enum 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 committed.
This helper function will create an Enum 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 committed .
public static EnumType CreateEnumTypeWithDefaultName(CommandProcessorContext cpc)
        {
            var service = cpc.EditingContext.GetEFArtifactService();
            var artifact = service.Artifact;
            var model = artifact.ConceptualModel();
            if (model == null)
            {
                throw new CannotLocateParentItemException();
            }
            var enumTypeName = ModelHelper.GetUniqueNameWithNumber(typeof(EnumType), model, Resources.Model_DefaultEnumTypeName);
            var cp = new CommandProcessor(cpc);
            var cmd = new CreateEnumTypeCommand(enumTypeName, null);
            cp.EnqueueCommand(cmd);
            cp.Invoke();
            return cmd.EnumType;
        }
public static EnumType CreateEnumTypeWithDefaultName ( CommandProcessorContext cpc ) { var service = cpc . EditingContext . GetEFArtifactService ( ) ; var artifact = service . Artifact ; var model = artifact . ConceptualModel ( ) ; if ( model == null ) { throw new CannotLocateParentItemException ( ) ; } var enumTypeName = ModelHelper . GetUniqueNameWithNumber ( typeof ( EnumType ) , model , Resources . Model_DefaultEnumTypeName ) ; var cp = new CommandProcessor ( cpc ) ; var cmd = new CreateEnumTypeCommand ( enumTypeName , null ) ; cp . EnqueueCommand ( cmd ) ; cp . Invoke ( ) ; return cmd . EnumType ; }
This helper function will create an Enum type using default name.
This helper function will create an Enum type using default name .
// the model that we want to add the complex type to // go create it
The new EnumType
The new EnumType
cpc
CommandProcessorContext
None