Skip to content

Instantly share code, notes, and snippets.

@rahulsahay19
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulsahay19/e28a6115c98b51a95a08 to your computer and use it in GitHub Desktop.
Save rahulsahay19/e28a6115c98b51a95a08 to your computer and use it in GitHub Desktop.
Finished form Employee service
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