Node.Cs-MVC 4 differences

All this project is based essentially in providing a system easily portable from .NET MVC to Node.Cs, but despite all my effort something was simply unavoidable due to the totally different architecture

Configuration

The "web.config" is used for Node.Cs application only as a shortcat to enable the original cshtml syntax highlighter. The new configuration file is the "node.config" that contains not only the settings that were previously inside the web.config but even those actually hidden inside the IIS configuration.

Running a website

No more IIS. All is based (at least concering the retrieval of data) on the .NET HttpListener class. I had two possible approaches available:

I took the latter. This because i did'nt liked to replicate too much copies of the main executable favoring for a single core that can be run with different configuration files. The other option would be to run the whole server as a Windows service. As sone as someone is interested...and inform me, that he would like this feature.

Global.asax

I wrote the equivalent of the Global.asax file to give an entry point for various customizations: Security providers, IOC containers, custom filters. The difference is that the global variables are store into the GlobalVars static class, and the AppStart method is replaced by the Application Start method.

Controllers

The controllers had to be totally replaced. Mostly because of the return type. Now the ActionResult is replaced by IEnumerable<IResponse>. This is needed by design because of the usage of the yield return as a control system for the program lifecycle. The construct "yield return" had replaced all "return".

The methods are more or less the same. But there is some less visible difference:

Cshtml

Now the only available source for the model is the Model variable. I hated the mix of model and Model :) The only real difference (apart from some missing helper function that i'll be glad to implement if you request them to me!) is when calling the various helper:

Instead of

    @Html.LabelFor(model=>model.MyField)

should be used

    @Html.LabelFor(()=>model.MyField)

As soon as i understand in depth how Microsoft did I'll allow both version!

Authentication

I did'nt liked the way authentication/authorization providers worked. I want my data source to handle my users in general, so in Node.Cs you are not tied to Windows Authorization to authenticate and this is reflected into a new way to initialize the authentication/authorization providers inside the GlobalNodeCs.cs

Missing features

I used the MvcMusicStore to implement the most useful (or at least the most poupular) functions but if in need of something present into .NET MVC that you would like on Node.Cs, just ask, and i'll add it as soon as possible!


Last modified on: February 28, 2014