diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-01 08:24:45 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-12-01 08:24:45 -0800 |
commit | 174eedd845a6ff6deeb1ad05c79bb6f80390e9ce (patch) | |
tree | d3a46f4b6508b9a169bd8026a41bb995d228b808 | |
parent | 0410f6a168d26c064f8a70397dce6393cb4e849b (diff) | |
download | DotNetOpenAuth-174eedd845a6ff6deeb1ad05c79bb6f80390e9ce.zip DotNetOpenAuth-174eedd845a6ff6deeb1ad05c79bb6f80390e9ce.tar.gz DotNetOpenAuth-174eedd845a6ff6deeb1ad05c79bb6f80390e9ce.tar.bz2 |
The name of the database in the project template is now based on the name of the created project.
4 files changed, 5 insertions, 5 deletions
diff --git a/projecttemplates/RelyingPartyLogic/Utilities.cs b/projecttemplates/RelyingPartyLogic/Utilities.cs index 5c9ae52..fb05306 100644 --- a/projecttemplates/RelyingPartyLogic/Utilities.cs +++ b/projecttemplates/RelyingPartyLogic/Utilities.cs @@ -38,7 +38,7 @@ namespace RelyingPartyLogic { } } - public static void CreateDatabase(Identifier claimedId, string friendlyId) { + public static void CreateDatabase(Identifier claimedId, string friendlyId, string databaseName) { const string SqlFormat = @" CREATE DATABASE [{0}] ON (NAME='{0}', FILENAME='{0}') GO @@ -52,7 +52,7 @@ GO using (var sr = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream(DefaultNamespace + ".CreateDatabase.sql"))) { schemaSql = sr.ReadToEnd(); } - string databasePath = HttpContext.Current.Server.MapPath("~/App_Data/Database.mdf"); + string databasePath = HttpContext.Current.Server.MapPath("~/App_Data/" + databaseName + ".mdf"); string sql = string.Format(CultureInfo.InvariantCulture, SqlFormat, databasePath, schemaSql, claimedId, "Admin"); var serverConnection = new ServerConnection(".\\sqlexpress"); diff --git a/projecttemplates/WebFormsRelyingParty/Setup.aspx b/projecttemplates/WebFormsRelyingParty/Setup.aspx index 128bb6d..61415d9 100644 --- a/projecttemplates/WebFormsRelyingParty/Setup.aspx +++ b/projecttemplates/WebFormsRelyingParty/Setup.aspx @@ -20,7 +20,7 @@ Just tell me what OpenID you will use to administer the site. </p> <rp:OpenIdLogin runat="server" ButtonText="Create database" ID="openidLogin" - OnLoggingIn="openidLogin_LoggingIn" + OnLoggingIn="openidLogin_LoggingIn" Stateless="true" TabIndex="1" LabelText="Administrator's OpenID:" ButtonToolTip="Clicking this button will create the database and initialize the OpenID you specify as an admin of this web site." RegisterText="get an OpenID" /> diff --git a/projecttemplates/WebFormsRelyingParty/Setup.aspx.cs b/projecttemplates/WebFormsRelyingParty/Setup.aspx.cs index 22125a4..7aed5d6 100644 --- a/projecttemplates/WebFormsRelyingParty/Setup.aspx.cs +++ b/projecttemplates/WebFormsRelyingParty/Setup.aspx.cs @@ -26,7 +26,7 @@ if (e.IsDirectedIdentity) { this.noOPIdentifierLabel.Visible = true; } else if (!this.databaseCreated) { - Utilities.CreateDatabase(e.ClaimedIdentifier, this.openidLogin.Text); + Utilities.CreateDatabase(e.ClaimedIdentifier, this.openidLogin.Text, "WebFormsRelyingParty"); this.MultiView1.ActiveViewIndex = 1; // indicate we have already created the database so that if the diff --git a/projecttemplates/WebFormsRelyingParty/Web.config b/projecttemplates/WebFormsRelyingParty/Web.config index 901626b..adac052 100644 --- a/projecttemplates/WebFormsRelyingParty/Web.config +++ b/projecttemplates/WebFormsRelyingParty/Web.config @@ -82,7 +82,7 @@ </log4net> <appSettings /> <connectionStrings> - <add name="DatabaseEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /> + <add name="DatabaseEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\WebFormsRelyingParty.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /> </connectionStrings> <system.web> <!-- |