added samples
[windows-sources.git] / sdk / samples / WCFSamples / TechnologySamples / Basic / Management / PerfCounters / CS / service / service.cs
blobf1a44c3f2a4a1efb33ecc171b5810d882eef59af
2 // Copyright (c) Microsoft Corporation. All Rights Reserved.
4 using System;
5 using System.ServiceModel;
6 using System.Diagnostics;
8 namespace Microsoft.ServiceModel.Samples
10 // Define a service contract.
11 [ServiceContract(Namespace="http://Microsoft.ServiceModel.Samples")]
12 public interface ICalculator
14 [OperationContract]
15 double Add(double n1, double n2);
16 [OperationContract]
17 double Subtract(double n1, double n2);
18 [OperationContract]
19 double Multiply(double n1, double n2);
20 [OperationContract]
21 double Divide(double n1, double n2);
24 // Service class which implements the service contract.
25 public class CalculatorService : ICalculator
27 public double Add(double n1, double n2)
29 return n1 + n2;
32 public double Subtract(double n1, double n2)
34 return n1 - n2;
37 public double Multiply(double n1, double n2)
39 return n1 * n2;
42 public double Divide(double n1, double n2)
44 return n1 / n2;