public sealed class IgnoreAttribute : AttributePublic NotInheritable Class IgnoreAttribute
Inherits Attributepublic ref class IgnoreAttribute sealed : public Attribute[<SealedAttribute>]
type IgnoreAttribute =
class
inherit Attribute
endThis allows additional properties not present in the result set or the underlying table being updated to be excluded when performing inserts and updates. Typically, both parameters are set to false but it is possible to set one or the other to true to include the property for insert or updates if required.
The attribute will usually be applied to properties in the type but can be applied to the class or structure with a property name specified to ignore inherited properties that should not be considered for inserts and updates. The attribute can be applied multiple times if there are multiple properties to ignore.
[LoadAllStoredProcedure("spStateCodes"), InsertStoredProcedure("spStateCodeAddUpdate"),
UpdateStoredProcedure("spStateCodeAddUpdate"), DeleteStoredProcedure("spStateCodeDelete")]
public sealed class StateCode : ChangeTrackingEntity
{
// The state code
[Key]
public string State
{
get;
set => this.SetWithNotify(value, ref field);
} = String.Empty;
// The state description
public string StateDesc
{
get;
set => this.SetWithNotify(value, ref field);
} = String.Empty;
// True if in use and cannot be deleted, false if not. This is a column in the
// load all stored procedure and we'll ignore it for inserts and updates.
[Ignore(true, true)]
public bool IsInUse
{
get;
set => this.SetWithNotify(value, ref field);
}
}// This entity has a HasErrors property inherited from ObservableValidator that needs to be
// ignored for inserts and updates. Since we don't have direct access to it, we use the
// attribute on the entity type and specify the property name as well.
[LoadAllStoredProcedure("spStateCodes"), InsertStoredProcedure("spStateCodeAddUpdate"),
UpdateStoredProcedure("spStateCodeAddUpdate"), DeleteStoredProcedure("spStateCodeDelete"),
Ignore(true, true, PropertyName = nameof(HasErrors))]
public sealed class StateCode : ObservableValidator
{
...
}| IgnoreAttribute | Initialize a new instance of the attribute using the given settings |
| ForInsert | This read-only property gets the ignored state of the property for insert stored procedures |
| ForUpdate | This read-only property gets the ignored state of the property for update stored procedures |
| PropertyName | This property is used when applied to a class or structure to specify a property name that should be ignored that does not appear directly in the type such as an inherited property. |
| TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from Attribute) |
| Equals | Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute) |
| GetHashCode | Returns the hash code for this instance. (Inherited from Attribute) |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| IsDefaultAttribute | When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Inherited from Attribute) |
| Match | When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute) |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| ToNullableT |
This is used to convert objects to null values if they are equal to null,
DBNull.Value, or the default value for the given type.
(Defined by DatabaseExtensions) |
| ToStringOrNull |
This is used to convert an object to a string and return either the string value if not empty, or
null if it is an empty string.
(Defined by DatabaseExtensions) |