Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Step for new Modul

  • Create Modul and Lib project
  • Create Folder structur and areas like webmodul
  • Add reference to Webframe.Infrastructur
  • install nuget packages in lib: entity framework
  • in frontend install: mvc5, RazorGenerator.MsBuild
  • create the modul configuration-> see other modul – Notice: That you installe the razorgenerator addin for visual studio before.

Important:

The lib is only for EF shizzl every other thing goes into the web project

Create a View

Install the ‘RazorGenerator.Mvc’ package, which registers a special view engine Go to an MVC Razor view’s property and set the Custom tool to RazorGenerator Optionally specify a value for Custom Tool Namespace to specify a namespace for the generated file. The project namespace is used by default. Optionally specify one of the generators in the first line of your Razor file. A generator declaration line looks like this: @* Generator: MvcHelper *@ . If you don’t specify this, a generator is picked based on convention (e.g. files under Views are treated as MvcViews) You’ll see a generated .cs file under the .cshtml file, which will be used at runtime instead of the .cshtml file You can also go to the nuget Package Manager Console and run ‘Enable-RazorGenerator’ to enable the Custom Tool on all the views. And to cause all the views to be regenerated, go to the nuget Package Manager Console and run ‘Redo-RazorGenerator’. This is useful when you update the generator package and it needs to generate different code.

Prefix every table

In every modul the tablenames must be prefixed!

protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Types().Configure(entity => entity.ToTable("EasyWeb_" + entity.ClrType.Name)); }

First Migrations

If you make the first migration you had to comment out, all tables from basecontext, such as user, application, servers

Publish Webframe

Just click Publish and copy the files. But dont forget to copy the EntityFramework.SqlServer.dll by hand to the bin folder. If you want that it works ;)