Change from SQL CE to SQL Express

This commit is contained in:
2015-01-14 14:41:04 -05:00
parent 822f6ccdea
commit f54f92330b
21 changed files with 383 additions and 413 deletions

View File

@@ -10,20 +10,23 @@ using WeatherService.SignalR;
namespace WeatherService
{
[WindowsService("WeatherService", DisplayName = "Weather Reporting Service", Description = "", StartMode = ServiceStartMode.Automatic, ServiceAccount = ServiceAccount.LocalSystem)]
[WindowsService("WeatherReporting", DisplayName = "Weather Reporting", Description = "", StartMode = ServiceStartMode.Automatic, ServiceAccount = ServiceAccount.LocalSystem)]
public class ServiceImplementation : IWindowsService
{
private List<WebServiceHost> _serviceHosts = new List<WebServiceHost>();
private List<WebServiceHost> _serviceHosts;
private IDisposable _signalR;
public void OnStart(string[] args)
{
using (new BeginEndTracer(GetType().Name, "OnStart"))
using (new BeginEndTracer(GetType().Name))
{
try
{
_serviceHosts.Add(new WebServiceHost(typeof(WeatherService)));
_serviceHosts.Add(new WebServiceHost(typeof(WeatherServiceDuplex)));
_serviceHosts = new List<WebServiceHost>
{
new WebServiceHost(typeof (WeatherService)),
new WebServiceHost(typeof (WeatherServiceDuplex))
};
_serviceHosts.ForEach(h => h.Open());
@@ -31,6 +34,7 @@ namespace WeatherService
Trace.Listeners.Remove("HostingTraceListener");
Program.Session = new Session();
Program.Session.Initialize();
Program.Session.StartRefresh();
}
@@ -44,15 +48,15 @@ namespace WeatherService
public void OnStop()
{
using (new BeginEndTracer(GetType().Name, "OnStop"))
using (new BeginEndTracer(GetType().Name))
{
try
{
_signalR.Dispose();
Program.Session.StopRefresh();
Program.Session.Terminate();
_signalR.Dispose();
_serviceHosts.ForEach(h => h.Close());
_serviceHosts.Clear();
}