Adding EF initialization
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using LeafWeb.Core.DAL;
|
||||
using LeafWeb.Web.ViewModels.LeafInput;
|
||||
|
||||
namespace LeafWeb.Web.Controllers
|
||||
@@ -9,8 +10,12 @@ namespace LeafWeb.Web.Controllers
|
||||
{
|
||||
public ActionResult Index()
|
||||
{
|
||||
// initialize the session storage to retain SessionID between requests
|
||||
Session["placeholder"] = 0;
|
||||
var dataService = new DataService();
|
||||
var fluxnetSites = dataService.GetFluxnetSites().ToList();
|
||||
|
||||
|
||||
// initialize the session storage to retain SessionID between requests
|
||||
Session["placeholder"] = 0;
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
+5
-2
@@ -1,6 +1,7 @@
|
||||
using System.Web.Optimization;using System.Web.Mvc;
|
||||
using System.Web.Optimization;
|
||||
using System.Web.Optimization;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using LeafWeb.Core.DAL;
|
||||
using LeafWeb.Web.App_Start;
|
||||
|
||||
namespace LeafWeb.Web
|
||||
@@ -13,6 +14,8 @@ namespace LeafWeb.Web
|
||||
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||||
BundleConfig.RegisterBundles(BundleTable.Bundles);
|
||||
BootstrapEditorTemplatesConfig.RegisterBundles();
|
||||
|
||||
DataService.RegisterInitializer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
-->
|
||||
<section name="backload" type="Backload.Configuration.BackloadSection, Backload, Version=2, Culture=neutral, PublicKeyToken=02eaf42ab375d363" requirePermission="false" />
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<add name="LeafWebContext" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=LeafWeb;Integrated Security=True;Connect Timeout=60" providerName="System.Data.SqlClient" />
|
||||
</connectionStrings>
|
||||
<appSettings>
|
||||
<add key="webpages:Version" value="3.0.0.0" />
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
|
||||
Reference in New Issue
Block a user