Class IgnoreAttribute
- Namespace
- ForgeMap
- Assembly
- ForgeMap.Abstractions.dll
Ignores specified destination properties during forging.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public sealed class IgnoreAttribute : Attribute
- Inheritance
-
objectAttributeIgnoreAttribute
Remarks
Use this attribute to prevent over-posting or mass assignment when mapping from untrusted
sources. For example, [Ignore("IsAdmin", "Role")] ensures those destination
properties are not set by the generated mapping code for that annotated forge method.
Constructors
IgnoreAttribute(params string[])
Creates a new IgnoreAttribute with the specified property names.
public IgnoreAttribute(params string[] propertyNames)
Parameters
propertyNamesstring[]The names of destination properties to ignore.
Properties
PropertyNames
Gets the names of destination properties to ignore.
public string[] PropertyNames { get; }
Property Value
- string[]