using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Text; namespace WcfServiceContract { public class mojKalkulator : IKalkulator { public double Dodaj(double n1, double n2) { double res = n1 + n2; Console.WriteLine(n1 + "+" + n2 + "=" + res); return res; } public double Odejmij(double n1, double n2) { double res = n1 - n2; Console.WriteLine(n1 + "-" + n2 + "=" + res); return res; } public double Pomnoz(double n1, double n2) { double res = n1 * n2; Console.WriteLine(n1 + "*" + n2 + "=" + res); return res; } public double Podziel(double n1, double n2) { double res = n1 / n2; Console.WriteLine(n1 + "/" + n2 + "=" + res); return res; } } // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together. public class Service1 : IService1 { public string GetData(int value) { return string.Format("You entered: {0}", value); } public CompositeType GetDataUsingDataContract(CompositeType composite) { if (composite == null) { throw new ArgumentNullException("composite"); } if (composite.BoolValue) { composite.StringValue += "Suffix"; } return composite; } } }