Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 866 Bytes

PREVENTCRUDATTRIBUTE.md

File metadata and controls

17 lines (12 loc) · 866 Bytes

PreventCrud Attribute

The PreventCrud attribute is optional. This is used to prevent some or all CRUD operations on a model.

The following example will prevent all CRUD operations on the Address model. This is useful for models that will always be stored within another model.

[PreventCrud]
public class Address

The following example will prevent Updating, all forms of Partial Updating, and all forms of Deleting the CreationMetadata. This is useful when limiting CRUD operations is required. In this example CreationMetadata is required to be a readonly model.

[PreventCrud(CrudOperation.Update, CrudOperation.PartialUpdate, CrudOperation.Delete)]
public class CreationMetadata