added samples
[windows-sources.git] / sdk / samples / WCFSamples / TechnologySamples / Basic / Client / RetrieveMetadata / CS / service / service.cs
blob888698264e3188c19b5421beef547c3d1b4b1165
2 // Copyright (c) Microsoft Corporation. All Rights Reserved.
4 using System;
5 using System.ServiceModel;
7 namespace Microsoft.ServiceModel.Samples
9 // Define a service contract.
10 [ServiceContract(Namespace="http://Microsoft.ServiceModel.Samples")]
11 public interface ICalculator
13 [OperationContract]
14 double Add(double n1, double n2);
15 [OperationContract]
16 double Subtract(double n1, double n2);
17 [OperationContract]
18 double Multiply(double n1, double n2);
19 [OperationContract]
20 double Divide(double n1, double n2);
23 // Service class which implements the service contract.
24 public class CalculatorService : ICalculator
26 public double Add(double n1, double n2)
28 return n1 + n2;
31 public double Subtract(double n1, double n2)
33 return n1 - n2;
36 public double Multiply(double n1, double n2)
38 return n1 * n2;
41 public double Divide(double n1, double n2)
43 return n1 / n2;