Manually create the SQL Server tables used by de SimpleMembershipProvider

  Below you will find the t-sql code needed to generate de SQL Server SimpleMembershipProvider tables.     set ansi_nulls on go set quoted_identifier on go if object_id(‘dbo.webpages_Membership’) is null begin create table dbo.webpages_Membership ( UserId int not null constraint PK_Membership_UserId primary key, CreateDate datetime null, ConfirmationToken nvarchar(128) null, IsConfirmed …

How to make Entity Framework 5.0 use an in-memory persistence DbContext instead of accessing the database.

If you want to switch between in-memory stub data and a database during runtime with Entity Framework 5.0, you have several options, some of them are: – Using a second level cache mechanism like http://www.codeproject.com/Articles/435142/Entity-Framework-Second-Level-Caching-with-DbConte , filling the cache before use and setting the expiration time to infinite. – Creating …

MVC tip: use Url.Content in script src attribute, in *.cshtml files!

In your "*.cshtml" pages, use Url.Content and don’t directly specify the locations of the JavaScript files, because specifying the JavaSript files directly will result in 404 error, when using a virtual directory/application within a IIS website.   So use <!DOCTYPE html> <html> <head> <title>@ViewBag.Title</title> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script …