DataSetValuesFromModel Method

Passes values from a model to a DataRow using property attributes.

Definition

Namespace: Aliquo.Core
Assembly: Aliquo.Core (in Aliquo.Core.dll) Version: 5.0.9179.22651
C#
public static void SetValuesFromModel(
	DataRow row,
	Object obj,
	List<string> excludeFields = null,
	List<string> excludeProperties = null
)

Parameters

row  DataRow
DataRow where the values will be assigned.
obj  Object
Model object that contains the values to be transferred.
excludeFields  ListString  (Optional)
List of fields to exclude.
excludeProperties  ListString  (Optional)
List of model properties to exclude.

Remarks

Available properties:

- ColumnAttribute: identifies the data column to which it is mapped.

- NotMappedAttribute: indicates if the column is not mapped.

- DataTypeAttribute: identifies the type of data.

- CutTypeStringAttribute: determines the type of cut to be made in the text type values (by default it is cut from the right).

- EnumValueTypeAttribute: determines the type of value used in the enumeration property.

- ExtendedDataFieldsAttribute: indicates whether the property corresponds to a list of DataField.

See Also