Click here to Skip to main content
15,885,944 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
C#
namespace EmployeeService
{
    [ServiceContract]
    public interface IEmployees
    {
        [OperationContract]
        List<employee> GetAllEmpDetails();

        [OperationContract]
        [WebInvoke(Method = "GET",
          RequestFormat = WebMessageFormat.Xml,
          ResponseFormat = WebMessageFormat.Xml,
          BodyStyle = WebMessageBodyStyle.Wrapped,
          UriTemplate = "Employee/{id}")]
        
        List<employee> GetEmpDetailsbyId(string id);

    }

    [DataContract]
    public class Employee
    {
        [DataMember]
        public string EmpID { get; set; }
        [DataMember]
        public string EmpName { get; set; }
        [DataMember]
        public string Department { get; set; }
        [DataMember]
        public string Designation { get; set; }

    }
}
Posted
Updated 15-Dec-14 2:33am
v3
Comments
Jameel VM 12-Dec-14 0:47am    
did u mean rest service?
Vishnupriyan91 15-Dec-14 8:05am    
Ya Jameel...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900