using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace WCFService
{

    /// <summary>
    /// STEP 1:  Create the Service Contract.
    ///  
    /// (WCFService Project)
    /// Open a new console project. Do the following steps:
    /// 
    /// 1) Add a reference "System.ServiceModel" to the project.
    /// 2) Add the namespace "System.ServiceModel" to the class file.
    /// 3) Create the Service contract interface "IFirstWCFService" by using the contract attributes.
    /// 4) Implements the interface "IFirstWCFService" with the class "FrtWCFService".
    ///
    ///
    /// </summary>

  [ServiceContract]
   public interface IFirstWCFService
    {
      // this method is exposed in the contract.
        [OperationContract]
        int Add(int x, int y);

        // this method is exposed in the contract.
        [OperationContract]
        string Hello(string strName);

        // this method will not be exposed in the contract.
        int Multiplication(int x, int y);
    }


    /// <summary>
    /// Implements the interface IFirstWCFService
    /// </summary>
    public class FrtWCFService : IFirstWCFService
    {
        public int Add(int x, int y)
        {
            return x + y;
        }

        public string Hello(string strName)
        {
            return "WCF program  : " + strName;
        }


        public int Multiplication(int x, int y)
        {
            return x * y;
        }

    }

    

}
