src/Misc/EFTools/EntityDesignModel/Commands/CreatePropertyCommand.cs
/// <summary>
///     Creates a new property in the passed in storage entity and optionally sets additional
///     facets on the property.
///     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 property</param>
/// <param name="entityType">Must be a storage entity</param>
/// <param name="type">The type to use for this property (cannot be empty)</param>
/// <param name="nullable">Flag whether the property is nullable or not</param>
/// <param name="theDefault">Optional: the default value for this property</param>
/// <param name="maxLength">Optional facet</param>
/// <param name="fixedLength">Optional facet</param>
/// <param name="precision">Optional facet</param>
/// <param name="scale">Optional facet</param>
/// <param name="unicode">Optional facet</param>
/// <param name="collation">Optional facet</param>
/// <param name="concurrencyMode">Optional: the concurrency mode for this property</param>
/// <returns>The new Property</returns>
Creates a new property in the passed in storage entity and optionally sets additional
facets on the property.
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.
Creates a new property in the passed in storage entity and optionally sets additional facets on the property . 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 Property CreateStorageProperty(
            CommandProcessorContext cpc, string name, StorageEntityType entityType,
            string type, bool? nullable, StringOrNone theDefault, StringOrPrimitive<UInt32> maxLength, BoolOrNone fixedLength,
            StringOrPrimitive<UInt32> precision,
            StringOrPrimitive<UInt32> scale, BoolOrNone unicode, StringOrNone collation, string concurrencyMode)
        {
            CommandValidation.ValidateStorageEntityType(entityType);
            var cpcd = new CreatePropertyCommand(name, entityType, type, nullable);
            var ssp = new SetPropertyFacetsCommand(
                cpcd, theDefault, maxLength, fixedLength, precision, scale, unicode, collation, concurrencyMode);
            var cp = new CommandProcessor(cpc, cpcd, ssp);
            cp.Invoke();
            return cpcd.CreatedProperty;
        }
internal static Property CreateStorageProperty ( CommandProcessorContext cpc , string name , StorageEntityType entityType , string type , bool ? nullable , StringOrNone theDefault , StringOrPrimitive < UInt32 > maxLength , BoolOrNone fixedLength , StringOrPrimitive < UInt32 > precision , StringOrPrimitive < UInt32 > scale , BoolOrNone unicode , StringOrNone collation , string concurrencyMode ) { CommandValidation . ValidateStorageEntityType ( entityType ) ; var cpcd = new CreatePropertyCommand ( name , entityType , type , nullable ) ; var ssp = new SetPropertyFacetsCommand ( cpcd , theDefault , maxLength , fixedLength , precision , scale , unicode , collation , concurrencyMode ) ; var cp = new CommandProcessor ( cpc , cpcd , ssp ) ; cp . Invoke ( ) ; return cpcd . CreatedProperty ; }
Creates a new property in the passed in storage entity and optionally sets additional
facets on the property.
Creates a new property in the passed in storage entity and optionally sets additional facets on the property .
The new Property
The new Property
cpc
CommandProcessorContext
None
name
string
The name of the property
The name of the property
entityType
StorageEntityType
Must be a storage entity
Must be a storage entity
type
string
The type to use for this property (cannot be empty)
The type to use for this property ( cannot be empty )
nullable
bool?
Flag whether the property is nullable or not
Flag whether the property is nullable or not
theDefault
StringOrNone
the default value for this property
the default value for this property
maxLength
StringOrPrimitive<UInt32>
None
fixedLength
BoolOrNone
None
precision
StringOrPrimitive<UInt32>
None
scale
StringOrPrimitive<UInt32>
None
unicode
BoolOrNone
None
collation
StringOrNone
None
concurrencyMode
string
the concurrency mode for this property
the concurrency mode for this property