Facebook
From Walloping Anoa, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 250
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.Serialization;
  5. using System.ServiceModel;
  6. using System.Text;
  7.  
  8. namespace WcfServiceContract
  9. {
  10.     public class mojKalkulator : IKalkulator
  11.     {
  12.         public double Dodaj(double n1, double n2)
  13.         {
  14.             double res = n1 + n2;
  15.             Console.WriteLine(n1 + "+" + n2 + "=" + res);
  16.             return res;
  17.         }
  18.         public double Odejmij(double n1, double n2)
  19.         {
  20.             double res = n1 - n2;
  21.             Console.WriteLine(n1 + "-" + n2 + "=" + res);
  22.             return res;
  23.         }
  24.         public double Pomnoz(double n1, double n2)
  25.         {
  26.             double res = n1 * n2;
  27.             Console.WriteLine(n1 + "*" + n2 + "=" + res);
  28.             return res;
  29.         }
  30.         public double Podziel(double n1, double n2)
  31.         {
  32.             double res = n1 / n2;
  33.             Console.WriteLine(n1 + "/" + n2 + "=" + res);
  34.             return res;
  35.         }
  36.     }
  37.     // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
  38.     public class Service1 : IService1
  39.     {
  40.         public string GetData(int value)
  41.         {
  42.             return string.Format("You entered: {0}", value);
  43.         }
  44.  
  45.         public CompositeType GetDataUsingDataContract(CompositeType composite)
  46.         {
  47.             if (composite == null)
  48.             {
  49.                 throw new ArgumentNullException("composite");
  50.             }
  51.             if (composite.BoolValue)
  52.             {
  53.                 composite.StringValue += "Suffix";
  54.             }
  55.             return composite;
  56.         }
  57.     }
  58. }
  59.