How To: Remove Northwind & Other Samples From Serene

After you take Northwind as a sample, and develop your own project, you would want to remove Northwind module, and other sample artifacts from your project.

Here is how to get rid of them.

We assume your solution name is MyProject, so you have MyProject.Web project in your solution.

Perform steps below in Visual Studio:

Removing Project Folders

  • Remove MyProject.Web/Modules/AdminLTE folder. This will remove all server side code related to theme samples.

  • Remove MyProject.Web/Modules/BasicSamples folder. This will remove all server side code related to basic samples.

  • Remove MyProject.Web/Modules/Northwind folder. This will remove all server side code related to Northwind.

Removing Navigation Items

Navigation items for these modules are moved under relevant modules folder in v2.5.3. If you are using an older version,

  • Open MyProject.Web/Modules/Common/Navigation/NavigationItems.cs, remove all lines with Northwind, Basic Samples and Theme Samples and remove these two lines:
  1. using Northwind = MovieTutorial.Northwind.Pages;
  2. using Basic = MovieTutorial.BasicSamples.Pages;

Removing Migration Scripts

Remove folder MyProject.Web/Modules/Common/Migrations/NorthwindDB/ with all files under it.

Remove “Northwind” from following line in MyProject.Web/App_Start/ SiteInitialization.Migrations.cs:

  1. private static string[] databaseKeys = new[] { "Default", "Northwind" };

Also remove Northwind connection string from web.config.

  1. <add name="Northwind" connectionString="Data Source=(LocalDb)\v11.0;
  2. Initial Catalog=MovieTutorial_Northwind_v1;
  3. Integrated Security=True"
  4. providerName="System.Data.SqlClient" />

Removing LESS Entries

  • Open MyProject.Web/Content/site/site.less file, remove following lines:
  1. @import "site.basicsamples.less";
  2. @import "site.northwind.less";
  • Remove MyProject.Web/Content/site/site.basicsamples.less file.
  • Remove MyProject.Web/Content/site/site.northwind.less file.

  • Open MyProject.Web/Content/site/rtl.css file, remove sections with Northwind.

Removing Localization Texts

  • Open MyProject.Web/Modules/Texts.cs and remove following lines:
  1. public static LocalText NorthwindPhone = "...";
  2. public static LocalText NorthwindPhoneMultiple = "...";
  • Remove folder MyProject.Web/Scripts/site/texts/northwind
  • Remove folder MyProject.Web/Scripts/site/texts/samples

Removing Northwind / Samples Generated Code

  • Expand MyProject.Web/Modules/Common/Imports/ ServerTypings/ServerTypings.tt. Select files starting with Northwind., BasicSamples. and delete them.

Removing Northwind Numbers From Dashboard

Open DashboardPage.cs, remove these using lines:

  1. using Northwind;
  2. using Northwind.Entities;

As Dashboard gets numbers from Northwind tables, you should modify Index() action like this:

  1. [Authorize, HttpGet, Route("~/")]
  2. public ActionResult Index()
  3. {
  4. var cachedModel = new DashboardPageModel()
  5. {
  6. };
  7. return View(MVC.Views.Common.Dashboard.DashboardIndex, cachedModel);
  8. }

You should replace this model with something specific to your site, and modify DashboardIndex accordingly.

Open DashboardIndex.cshtml, clear href attributes containing “Northwind” like:

  1. <a href="~/Northwind/Order?shippingState=1"></a>
  2. <a href=""></a>

Building Project and Running T4 (.tt) Templates

  • Now rebuild your solution.

  • Make sure it is built successfully before executing next step.

  • Click Build menu and click Transform All Templates.

  • Rebuild your solution again.

  • Search for Northwind, Basic Samples and Theme Samples in all solution items. It should find no results.

  • Run your project, now Northwind and Sample menus are gone.

Removing Northwind Tables

Northwind tables are in a separate database, so you can just drop it.