Time for creation of database on site
Posted
by slo2ols
on Stack Overflow
See other posts from Stack Overflow
or by slo2ols
Published on 2010-05-21T09:51:03Z
Indexed on
2010/05/21
12:40 UTC
Read the original article
Hit count: 134
asp.net-mvc-2
|entity-framework-4
Hi. When and where would you create database to develop web site using ASP.NET MVC 2 and Entity Framework 4 (CreateDatabase method). I think about first run of web site and redirect on welcome page, when controller creates database from model. But I doubt about details: 1. Where? In HttpModule, but request of any image or css will check that database exist. In custom RouteHandler, but then anybody need to know that need to use this handler when to add route. In BaseController, but then code will look like SomeController(..., IDatabase database) : base(database). 2. When? Better create database on first run by any url or may be on deployment of site (additional tool which create ObjectContext and invoke CreateDatabase)? Thanks.
© Stack Overflow or respective owner