none
DurableService Attribute from System.ServiceModel seems to be deprecated RRS feed

  • Question

  • When I add the DurableService Attribute to my Service, such as shown in the code posted on the bottom of this thread (taken from here) I get the following message:

    The wf3 types are deprecated. Instead please use the new WF4 types from System.Activities

    Unfortunately, I cannot find any DurableService Attribute in System.Activities. Is there any Sample that shows how to set up a Durable Service (WCF Service with Persistence) in .NET 4.5?

    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.Text;
    using System.ServiceModel.Description;
    
    [Serializable]
    [DurableService()]
    public class SimpleCalculator :ISimpleCalculator 
    {
    	int currentValue = default(int);
    	[DurableOperation(CanCreateInstance = true)]
    	public int Add(int num)
    	{
    		return (currentValue += num);
    	}
    	[DurableOperation()]
    	public int Subtract(int num)
    	{
    		return (currentValue -= num);
    	}
    	[DurableOperation()]
    	public int Multiply(int num)
    	{
    		return (currentValue *= num);
    	}
    	[DurableOperation(CompletesInstance = true)]
    	public void EndPersistence()
    	{
    	}
    }
    Tuesday, August 5, 2014 7:31 AM

Answers

All replies