DeliveryRequirementsAttribute.RequireOrderedDelivery Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Especifica se a ligação deve suportar mensagens ordenadas.
public:
property bool RequireOrderedDelivery { bool get(); void set(bool value); };
public bool RequireOrderedDelivery { get; set; }
member this.RequireOrderedDelivery : bool with get, set
Public Property RequireOrderedDelivery As Boolean
Valor de Propriedade
true instrui Windows Communication Foundation (WCF) a confirmar que a ligação deve suportar a ordenação das mensagens; caso contrário, false. A predefinição é false.
Exemplos
O exemplo de código seguinte usa o DeliveryRequirementsAttribute atributo para instruir o WCF a confirmar em tempo de execução que a ligação real suporta mensagens ordenadas.
using System;
using System.ServiceModel;
[ServiceContract]
interface ICalculatorService
{
[OperationBehavior()]
int Add(int a, int b);
[OperationContract]
int Subtract(int a, int b);
}
[DeliveryRequirementsAttribute(
QueuedDeliveryRequirements=QueuedDeliveryRequirementsMode.NotAllowed,
RequireOrderedDelivery=true
)]
class CalculatorService: ICalculatorService
{
public int Add(int a, int b)
{
Console.WriteLine("Add called.");
return a + b;
}
public int Subtract(int a, int b)
{
Console.WriteLine("Subtract called.");
return a - b;
}
public int Multiply(int a, int b)
{
return a * b;
}
}
Imports System.ServiceModel
<ServiceContract()> _
Public Interface ICalculatorService
<OperationBehavior()> _
Function Add(ByVal a As Integer, ByVal b As Integer) As Integer
<OperationContract()> _
Function Subtract(ByVal a As Integer, ByVal b As Integer) As Integer
End Interface
<DeliveryRequirements( _
QueuedDeliveryRequirements:=QueuedDeliveryRequirementsMode.NotAllowed, _
RequireOrderedDelivery:=True _
)> _
Class CalculatorService
Public Function add(ByVal a As Integer, ByVal b As Integer) As Integer
Console.WriteLine("Add called")
Return a + b
End Function
Public Function Subtract(ByVal a As Integer, ByVal b As Integer) As Integer
Console.WriteLine("Subtract called.")
Return a - b
End Function
Public Function Multiply(ByVal a As Integer, ByVal b As Integer) As Integer
Return a * b
End Function
End Class
Observações
Definir a RequireOrderedDelivery propriedade para false instrui a WCF a não realizar qualquer validação.