|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Signum.Web;
using System.Web.Mvc;
using System.Web.Hosting;
using Signum.Web.PortableAreas;
using System.Web.Compilation;
using Signum.Web.Properties;
using Signum.Web.Controllers;
[assembly: PreApplicationStartMethod(typeof(Signum.Web.PreApplicationStartCode), "Start")]
namespace Signum.Web
{
public static class PreApplicationStartCode
{
private static bool _startWasCalled;
public static void Start()
{
if (_startWasCalled)
{
return;
}
_startWasCalled = true;
//be sure default buildproviders are registered first
System.Web.WebPages.PreApplicationStartCode.Start();
System.Web.WebPages.Razor.PreApplicationStartCode.Start();
ControllerBuilder.Current.SetControllerFactory(new SignumControllerFactory());
HostingEnvironment.RegisterVirtualPathProvider(new CompiledVirtualPathProvider(HostingEnvironment.VirtualPathProvider));
BuildProvider.RegisterBuildProvider(".cshtml", typeof(CompiledRazorBuildProvider));
ModelBinders.Binders.DefaultBinder = new LiteModelBinder();
ModelBinders.Binders.Add(typeof(FindOptions), new FindOptionsModelBinder());
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm Computer Scientist, one of the founders of Signum Software, and the lead developer behind Signum Framework.
www.signumframework.com
I love programming in C#, Linq, Compilers, Algorithms, Functional Programming, Computer Graphics, Maths...