FormModel MembersNFX Class Library

[This is preliminary documentation and is subject to change.]

The FormModel type exposes the following members.
Constructors

  NameDescription
Protected methodFormModel
Initializes a new instance of the FormModel class
Back to Top
Methods

  NameDescription
Public methodAfterLoad
Invoked to allow the row to hydrate its fields/state from AmorphousData bag. For example, this may be used to reconstruct some temporary object state that is not stored as a part of established business schema. The operation is performed per particular targetName (name of physical backend). Simply put, this method allows business code to "specify what to do after object gets loaded from THE PARTICULAR TARGET backend store". An example: suppose current MongoDB collection stores 3 fields for name, and we want to collapse First/Last/Middle name fields into one field. If we change rowschema then it will only contain 1 field which is not present in the database, however those 'older' fields will get populated into AmorphousData giving us an option to merge older 3 fields into 1 within AfterLoad() implementation
(Inherited from AmorphousTypedRow.)
Public methodApplyDefaultFieldValues
Writes default values specified in schema into fields. Pass overwrite=true to force defaults over non-null existing values (false by default)
(Inherited from Row.)
Public methodBeforeSave
Invoked to allow the row to transform its state into AmorphousData bag. For example, this may be usefull to store extra data that is not a part of established business schema. The operation is performed per particular targetName (name of physical backend). Simply put, this method allows business code to "specify what to do before object gets saved in THE PARTICULAR TARGET backend store"
(Inherited from AmorphousTypedRow.)
Protected methodCheckMinMax (Inherited from Row.)
Public methodConfigure
In base class applies Config attribute. Useful for typed rows
(Inherited from Row.)
Public methodConvertFieldValueToDef
Converts field value to the type specified by Schema.FieldDef. For example converts GDID->ulong or ulong->GDID. This method can be overridden to perform custom handling of types, for example one can assign bool field as "Si" that would convert to TRUE. This method is called by SetFieldValue(...) before assigning actual field buffer
(Inherited from Row.)
Public methodCopyFields
Copies fields from this row into another row/form. Note: this is shallow copy, as field values for complex types are just copied over
(Inherited from Row.)
Protected methodDoSave
Override to save model into data store. Return "predictable" exception (such as key violation) as a value instead of throwing. Throw only in "un-predictable" cases (such as DB connection is down, not enough space etc...). Return extra result obtained during save i.e. a db-assigned auto-inc field
Public methodEquals(Object)
Object override - sealed. Override Equals(row) instead
(Inherited from Row.)
Public methodEquals(Row)
Override to perform custom row equality comparison. Default implementation equates rows using their key fields
(Inherited from Row.)
Protected methodFilterJSONSerializerField
Override to filter-out some fields from serialization to JSON, or change field values. Return name null to indicate that field should be filtered-out(excluded from serialization to JSON)
(Inherited from Row.)
Protected methodOnlineFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from OnlineObject.)
Public methodGetClientFieldDef
Override to perform dynamic substitute of field def for the specified field. This method is used by client ui/scaffolding to extract dynamic definition for a field (i.e. field description, requirement, value list etc.) as dictated by business logic. This method IS NOT used by row validation, only by client that feeds from row's metadata. The default implementation returns the original field def, you can return a substituted field def per particular business logic
(Inherited from Row.)
Public methodGetClientFieldValue
Override to perform dynamic substitute of field value for the specified field. This method is used by client ui/scaffolding to extract field values for a field as dictated by business logic. This method IS NOT used by row validation, only by client that feeds from row's metadata. The default implementation returns the original GetFieldValue(fdef), you can return a substituted field value per particular business logic
(Inherited from Row.)
Public methodGetClientFieldValueList
Override to perform dynamic lookup of field value list for the specified field. This method is used by client ui/scaffolding to extract dynamic lookup values as dictated by business logic. This method IS NOT used by row validation, only by client that feeds from row's metadata. This is a simplified version of GetClientFieldDef
(Inherited from Row.)
Public methodGetDataStoreKey
Returns values for fields that represent row's primary key
(Inherited from Row.)
Public methodGetDisplayFieldValue(Int32, String, Func Object, Object )
Returns field value as string formatted per target DisplayFormat attribute
(Inherited from Row.)
Public methodGetDisplayFieldValue(String, String, Func Object, Object )
Returns field value as string formatted per target DisplayFormat attribute
(Inherited from Row.)
Public methodGetEnumerator (Inherited from Row.)
Public methodGetFieldValue (Inherited from TypedRow.)
Public methodGetFieldValueDescription(Int32, String, Boolean)
For fields with ValueList returns value's description per specified targeted schema
(Inherited from Row.)
Public methodGetFieldValueDescription(String, String, Boolean)
For fields with ValueList returns value's description per specified targeted schema
(Inherited from Row.)
Public methodGetHashCode
Object override - gets hash code from key fields
(Inherited from Row.)
Public methodOnlineGetType
Gets the OnlineType of the current instance.
(Inherited from OnlineObject.)
Protected methodOnlineMemberwiseClone
Creates a shallow copy of the current OnlineObject.
(Inherited from OnlineObject.)
Public methodPersistConfiguration
The base class does not implement this method. Override to persist row fields into config node
(Inherited from Row.)
Public methodSave(Object )
Saves form into data store. The form is validated first and validation error is returned which indicates that save did not succeed due to validation error/s. The core implementation is in DoSave() that can also abort by either returning execption when predictable failure happens on save (i.e. key violation). Other exceptions are thrown. Returns extra result obtained during save i.e. a db-assigned auto-inc field
Public methodSave TSaveResult (TSaveResult )
Saves form into data store. The form is validated first and validation error is returned which indicates that save did not succeed due to validation error/s. The core implementation is in DoSave() that can also abort by either returning execption when predictable failure happens on save (i.e. key violation). Other exceptions are thrown. Returns extra result obtained during save i.e. a db-assigned auto-inc field
Public methodSetFieldValue (Inherited from TypedRow.)
Public methodSetRoundtripBagFromJSONString
If non null or empty parses JSON content and sets the RoundtripBag
Public methodSimpleFilterPredicate
Returns true if this row satisfies simple filter - it contains the supplied filter string. The filter pattern may start or end with "*" char that denotes a wildcard. A wildcard is permitted on both sides of the filter value
(Inherited from Row.)
Public methodOnlineToString
Returns a string that represents the current object.
(Inherited from OnlineObject.)
Public methodValidate 
Performs validation of data in the row returning exception object that provides description in cases when validation does not pass. Validation is performed not targeting any particular backend
(Inherited from Row.)
Public methodValidate(String)
Validates row using row schema and supplied field definitions. Override to perform custom validations, i.e. TypeRows may directly access properties and write some validation type-safe code The method is not expected to throw exception in case of failed validation, rather return exception instance because throwing exception really hampers validation performance when many rows need to be validated
(Inherited from Row.)
Public methodValidateField(String, Schema FieldDef)
Validates row field using Schema.FieldDef settings. This method is invoked by base Validate() implementation. The method is not expected to throw exception in case of failed validation, rather return exception instance because throwing exception really hampers validation performance when many rows need to be validated
(Inherited from Row.)
Public methodValidateField(String, String)
Validates row field by name. Shortcut to ValidateField(Schema.FieldDef)
(Inherited from Row.)
Public methodWriteAsJSON
Writes row as JSON either as an array or map depending on JSONWritingOptions.RowsAsMap setting. Do not call this method directly, instead call rowset.ToJSON() or use JSONWriter class
(Inherited from Row.)
Back to Top
Extension Methods

  NameDescription
Public Extension MethodAsBool (Defined by ObjectValueConversion.)
Public Extension MethodAsByte (Defined by ObjectValueConversion.)
Public Extension MethodAsChar (Defined by ObjectValueConversion.)
Public Extension MethodAsDateTime Overloaded. (Defined by ObjectValueConversion.)
Public Extension MethodAsDateTime(DateTime, ConvertErrorHandling)Overloaded. (Defined by ObjectValueConversion.)
Public Extension MethodAsDecimal (Defined by ObjectValueConversion.)
Public Extension MethodAsDouble (Defined by ObjectValueConversion.)
Public Extension MethodAsEnum TEnum  (Defined by ObjectValueConversion.)
Public Extension MethodAsFloat (Defined by ObjectValueConversion.)
Public Extension MethodAsGDID Overloaded. (Defined by ObjectValueConversion.)
Public Extension MethodAsGDID(GDID, ConvertErrorHandling)Overloaded. (Defined by ObjectValueConversion.)
Public Extension MethodAsGDIDSymbol Overloaded. (Defined by ObjectValueConversion.)
Public Extension MethodAsGDIDSymbol(GDIDSymbol, ConvertErrorHandling)Overloaded. (Defined by ObjectValueConversion.)
Public Extension MethodAsGUID (Defined by ObjectValueConversion.)
Public Extension MethodAsInt (Defined by ObjectValueConversion.)
Public Extension MethodAsJSONConfig (Defined by ObjectValueConversion.)
Public Extension MethodAsLaconicConfig (Defined by ObjectValueConversion.)
Public Extension MethodAsLong (Defined by ObjectValueConversion.)
Public Extension MethodAsNonNullOrEmptyString (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableBool (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableByte (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableChar (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableDateTime (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableDecimal (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableDouble (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableEnum TEnum  (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableFloat (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableGDID (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableGDIDSymbol (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableGUID (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableInt (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableLong (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableSByte (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableShort (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableTimeSpan (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableUInt (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableULong (Defined by ObjectValueConversion.)
Public Extension MethodAsNullableUShort (Defined by ObjectValueConversion.)
Public Extension MethodAsSByte (Defined by ObjectValueConversion.)
Public Extension MethodAsShort (Defined by ObjectValueConversion.)
Public Extension MethodAsString (Defined by ObjectValueConversion.)
Public Extension MethodAsTimeSpan Overloaded. (Defined by ObjectValueConversion.)
Public Extension MethodAsTimeSpan(TimeSpan, ConvertErrorHandling)Overloaded. (Defined by ObjectValueConversion.)
Public Extension MethodAsUInt (Defined by ObjectValueConversion.)
Public Extension MethodAsULong (Defined by ObjectValueConversion.)
Public Extension MethodAsUri (Defined by ObjectValueConversion.)
Public Extension MethodAsUShort (Defined by ObjectValueConversion.)
Public Extension MethodAsXMLConfig (Defined by ObjectValueConversion.)
Public Extension MethodToErlObject Overloaded.
Try to convert .NET native object type to corresponding Erlang term. Throw exception if conversion is not possible
(Defined by ErlObject.)
Public Extension MethodToErlObject(ErlTypeOrder, Boolean)Overloaded.
Try to convert .NET native object type to corresponding Erlang term of given type. Throw exception if conversion is not possible
(Defined by ErlObject.)
Public Extension MethodToErlObject(String, String, Boolean)Overloaded.
Convert Row to a hierarchical term that corresponds to the row's schema. The Erlang term is in the form:
{SchemaName::atom(), [{FieldName::atom(), Value}]}.
(Defined by ErlSchemaUtils.)
Public Extension MethodToJSON(JSONWritingOptions)Overloaded.
Serializes object into JSON string
(Defined by JSONExtensions.)
Public Extension MethodToJSON(TextWriter, JSONWritingOptions)Overloaded.
Serializes object into JSON format using provided TextWriter
(Defined by JSONExtensions.)
Public Extension MethodToJSON(Stream, JSONWritingOptions, Encoding)Overloaded.
Serializes object into JSON format using provided stream and optional encoding
(Defined by JSONExtensions.)
Public Extension MethodUpdate
Convert an Erlang hierarchical term representing a schema to a Row.
(Defined by ErlSchemaUtils.)
Back to Top
Fields

  NameDescription
Public fieldCSRFToken
Gets/sets CSRF token
Public fieldFormMode
Gets/sets form mode - unspecified|insert|edit. This field may be queried by validate and save, i.e. Validate may perform extra cross checks on Insert - i.e. check whether some other user is already registered with the specified email in this form etc.
Public fieldStatic memberJSON_CSRF_PROPERTY
Public fieldStatic memberJSON_MODE_PROPERTY
Public fieldStatic memberJSON_ROUNDTRIP_PROPERTY
Back to Top
Properties

  NameDescription
Public propertyAmorphousData
Returns data that does not comply with known schema (dynamic data). The field names are NOT case-sensitive
(Inherited from AmorphousTypedRow.)
Public propertyAmorphousDataEnabled
False by default for forms, safer for web. For example, no injection of un-inteded fields can be done via web form post
(Overrides AmorphousTypedRow AmorphousDataEnabled.)
Public propertyDataStoreTargetName
Returns the name of data store target obtained from App.DataStore by default. Override to supply a different name. This property is used for validation
Public propertyHasRoundtripBag
True if RoundtripBag is allocated
Public propertyItem Int32 
Gets/sets field values by positional index(Order)
(Inherited from Row.)
Public propertyItem String 
Gets/sets field values by name
(Inherited from Row.)
Public propertyRoundtripBag
Returns lazily-allocated RoundtripBag. Use HasRoundtripBag to see if it is allocated not to allocate on get
Public propertySchema
References a schema for a table that this row is a part of
(Inherited from TypedRow.)
Back to Top
Explicit Interface Implementations

  NameDescription
Explicit interface implemetationPrivate methodIEnumerable GetEnumerator (Inherited from Row.)
Back to Top
See Also