/// <summary> /// Method to execute when the service starts. /// </summary> /// <param name="args"></param> protected override void OnStart(string[] args) { // Start database server. _databaseServer = DatabaseServer.CreateInstance(); _databaseServer.Open(); // Start RESTful resource service. _resourceService = ServiceHost.CreateInstance <ResourceService>(); _resourceService.Open(); // Start RESTful project service. _projectService = ServiceHost.CreateInstance <ProjectService>(); _projectService.Open(); }
static void Main(string[] args) { // Start database server. _databaseServer = DatabaseServer.CreateInstance(); _databaseServer.Open(); // Start RESTful resource service. _resourceService = ServiceHost.CreateInstance <ResourceService>(); _resourceService.Open(); // Start RESTful resource service. _projectService = ServiceHost.CreateInstance <ProjectService>(); _projectService.Open(); System.Console.WriteLine("Press enter to stop services..."); System.Console.ReadLine(); _projectService.Close(); _resourceService.Close(); _databaseServer.Close(); }