SqlMethodAttribute.InvokeIfReceiverIsNull 属性

定义

指示 SQL Server 是否应在 null 实例上调用此方法。Indicates whether SQL Server should invoke the method on null instances.

public:
 property bool InvokeIfReceiverIsNull { bool get(); void set(bool value); };
public bool InvokeIfReceiverIsNull { get; set; }
member this.InvokeIfReceiverIsNull : bool with get, set
Public Property InvokeIfReceiverIsNull As Boolean

属性值

Boolean

如果 SQL Server 应在 null 实例上调用此方法,则为 true;否则为 falsetrue if SQL Server should invoke the method on null instances; otherwise, false. 如果无法调用方法 (因为) 方法上的属性,则 DbNull 返回 SQL Server。If the method cannot be invoked (because of an attribute on the method), the SQL Server DbNull is returned.

注解

属性的默认值 InvokeIfReceiverIsNullfalseThe default value of the InvokeIfReceiverIsNull property is false. 也就是说,不会在 null 实例上调用方法。That is, the method is not invoked on a null instance. 如果 InvokeIfReceiverIsNulltrue ,则方法的返回值取决于其类型。If InvokeIfReceiverIsNull is true, the return value of the method depends upon its type. 如果该方法的返回类型可以为 null,则返回该类型的可分辨 null 值。If the return type of the method is nullable, the distinguished null value for the type is returned. 如果返回类型不可以为 null,则返回该类型的默认 CLR 值。If the return type is non-nullable, the default CLR value for the type is returned. 引用类型的默认值为 nullThe default value for reference types is null. 值类型的默认值是调用类型的无参数构造函数时返回的值。The default value for a value type is the value that is returned when you call the parameterless constructor for the type.

适用于