コード例 #1
0
 static void Main(string[] args)
 {
     Configurator.Congigure();
     Employee.Entity.Employee employee = ServiceRegistry.GetCurrent().GetService <IEmployeeService>().GetEmployeeById(1);
     ServiceRegistry.GetCurrent().GetService <IEmployeeService>().WriteEmployeeInfoToConsole(employee);
     Department.Entity.Department department = ServiceRegistry.GetCurrent().GetService <IDepartmentService>().GetDepartmentById(1);
     ServiceRegistry.GetCurrent().GetService <IDepartmentService>().WriteDepartmentInfoToConsole(department);
     Console.ReadKey();
 }
コード例 #2
0
 public static void Congigure()
 {
     ServiceRegistry.GetCurrent().Register(typeof(IEmployeeService), new EmployeeOperation()); // ilk register ornegi
     ServiceRegistry.GetCurrent().Register <IDepartmentService, DepartmentOperation>();        // ikinci register ornegi
 }