MasterDetailRelationAttribute class

namespace: Serenity.Data.Mapping   assemblySerenity.Net.Services

Defines a master detail relation (1-N) between this row and another

[AttributeUsage(AttributeTargets.Property)]
public sealed class MasterDetailRelationAttribute : Attribute
parameter description
foreignKey The property name of the FK field in the detail table which matches the PK (id) of the master table. For example, if the two tables are 'Order(Id, Date, ...)' and 'OrderDetail(DetailId, OrderId, Qty, ...)' it should be 'OrderId'.

Public Members

name description
MasterDetailRelationAttribute(…) Defines a master detail relation (1-N) between this row and another
CheckChangesOnUpdate { get; set; } Gets or sets a value indicating whether to check changes on update. Disable this if you are getting comparison errors.
ColumnSelection { get; set; } Gets or sets the column selection.
ColumnsType { get; set; } Gets or sets the columns type with properties to include in column selection
FilterField { get; set; } Gets or sets the filter field.
FilterValue { get; set; } Gets or sets the filter value.
ForceCascadeDelete { get; set; } Forces deletion of linking row records even if master record uses soft delete. If false (default) this doesn't delete linking records, as master record might be undeleted.
ForeignKey { get; } Gets the foreign key.
IncludeColumnNames { get; set; } Gets or sets the list of include column names as array.
IncludeColumns { get; set; } Gets or sets the comma separated list of include columns. Obsolete, please prefer IncludeColumnNames or ColumnsType
MasterKeyField { get; set; } Optional: override the default behaviour and use a different master id (PK) field (i.e. from a unique constraint)

Remarks

Initializes a new instance of the MasterDetailRelationAttribute class.

See Also