Last active
August 29, 2015 14:07
-
-
Save rahulsahay19/e28a6115c98b51a95a08 to your computer and use it in GitHub Desktop.
Finished form Employee service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.Serialization; | |
using System.ServiceModel; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace EmployeeService | |
{ | |
[DataContract] | |
public class Employee | |
{ | |
[DataMember] | |
public string Fname { get; set; } | |
[DataMember] | |
public string Lname { get; set; } | |
[DataMember] | |
public string Designation { get; set; } | |
} | |
[ServiceContract] | |
public interface IEmployeeService | |
{ | |
[OperationContract] | |
void SubmitEmployee(Employee Emp); | |
[OperationContract] | |
List<Employee> PrintEmployees(); | |
} | |
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] | |
public class EmployeeService : IEmployeeService | |
{ | |
List<Employee> _employees = new List<Employee>(); | |
public void SubmitEmployee(Employee Emp) | |
{ | |
_employees.Add(Emp); | |
} | |
public List<Employee> PrintEmployees() | |
{ | |
return _employees; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment