Var denne side nyttig?
Din feedback på dette indhold er vigtigt. Giv os din mening.
Mere feedback?
1500 tegn tilbage
Parameters Property
EN
Dette indhold er ikke tilgængeligt på dit sprog, men her er den engelske version.

SqlFilter.Parameters Property

 

Sets the value of a filter expression.

Namespace:   Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)

public IDictionary<stringobject> Parameters { get; }

Property Value

Type: System.Collections.Generic.IDictionary<StringObject>

The value of a filter expression.

You can use the Parameters property to define a parameterized expression that indirectly sets the value of a filter expression, rather than specifying the value as part of the filter expression itself. This is very similar to parameterized SQL.

A benefit to using parameterized filter expressions is that you do not have to escape the string as part of the filter expression grammar. This makes it easier, for example, to construct the filter expression based on user input. Additionally, the parameter enables you to use constant literals that are not part of the grammar, such as DateTime, DateTimeOffset, TimeSpan, Guid, and so on, since they can now appear directly as part of the Parameters property.

A valid parameter name always starts with the @ symbol, and the first character must be any Unicode character that is categorized as a Unicode letter. The second and subsequent characters can be any Unicode character that is categorized as a Unicode letter or a Unicode digit.

The following filter is identical to “MyProperty = 'SomeString'” but uses a parameter instead.

Filter filter = new SqlFilter("MyProperty = @myProperty")
{
    Parameters =
    {
        { "@myProperty", "SomeString" },
    }
};
Return to top
Vis:
© 2015 Microsoft