Class QueryFilterException
Thrown when a data-modifying statement would write a row that violates one of the entity type's
active global query filters. Unlike a WHERE clause, the filters are never injected into the
target of an INSERT/MERGE; instead the values being written (or the rows read by an
INSERT ... SELECT/query-sourced MERGE source) are validated against them before the
statement executes.
[Serializable]
public class QueryFilterException : DataContextException, ISerializable
- Inheritance
-
QueryFilterException
- Implements
- Inherited Members
- Extension Methods
Remarks
Derives from DataContextException so callers can catch a single library-wide base.
Validation is best effort: an INSERT ... SELECT/query-sourced MERGE pre-check is a
separate read, so a concurrent writer can still change the rows between the check and the write
(a TOCTOU race). The exception is not thrown for a partial batch after earlier rows were already
written; callers must not assume atomicity.
Constructors
QueryFilterException()
Initializes a new instance of the QueryFilterException class.
public QueryFilterException()
QueryFilterException(SerializationInfo, StreamingContext)
Initializes a new instance of the QueryFilterException class from serialized data.
[Obsolete(DiagnosticId = "SYSLIB0051")]
protected QueryFilterException(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoThe object that holds the serialized object data.
contextStreamingContextContextual information about the source or destination of the serialization.
QueryFilterException(string?)
Initializes a new instance of the QueryFilterException class with a specified error message.
public QueryFilterException(string? message)
Parameters
messagestringThe message that describes the error.
QueryFilterException(string?, Exception?)
Initializes a new instance of the QueryFilterException class with a specified error message and a reference to the inner exception that caused it.
public QueryFilterException(string? message, Exception? innerException)