();
+ ServiceLayerInitialise.InitialiseThis(context, canCreateDatabase: true);
+}
+
+if (!app.Environment.IsDevelopment())
+{
+ app.UseExceptionHandler("/Home/Error");
+}
+
+app.UseStaticFiles();
+
+app.UseRouting();
+
+app.MapControllerRoute(
+ name: "default",
+ pattern: "{controller=Home}/{action=Index}/{id?}");
+
+app.Run();
diff --git a/SampleWebApp/Project_Readme.html b/SampleWebApp/Project_Readme.html
deleted file mode 100644
index cb9e793..0000000
--- a/SampleWebApp/Project_Readme.html
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
- Your ASP.NET application
-
-
-
-
-
-
-
-
-
This application consists of:
-
- - Sample pages showing basic nav between Home, About, and Contact
- - Theming using Bootstrap
- - Authentication, if selected, shows how to register and sign in
- - ASP.NET features managed using NuGet
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SampleWebApp/Properties/AssemblyInfo.cs b/SampleWebApp/Properties/AssemblyInfo.cs
deleted file mode 100644
index 5605e92..0000000
--- a/SampleWebApp/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-#region licence
-// The MIT License (MIT)
-//
-// Filename: AssemblyInfo.cs
-// Date Created: 2014/05/20
-//
-// Copyright (c) 2014 Jon Smith (www.selectiveanalytics.com & www.thereformedprogrammer.net)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-#endregion
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("SampleWebApp")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SampleWebApp")]
-[assembly: AssemblyCopyright("Copyright © 2014")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("fa016029-8cb0-4ef3-a0e0-c94ac71c1177")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/SampleWebApp/Properties/Settings.Designer.cs b/SampleWebApp/Properties/Settings.Designer.cs
deleted file mode 100644
index 3781ad7..0000000
--- a/SampleWebApp/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.18444
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace SampleWebApp.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
-
- [global::System.Configuration.ApplicationScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("LocalHost")]
- public string HostTypeString {
- get {
- return ((string)(this["HostTypeString"]));
- }
- }
-
- [global::System.Configuration.ApplicationScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("jonsmith_")]
- public string DatabaseLoginPrefix {
- get {
- return ((string)(this["DatabaseLoginPrefix"]));
- }
- }
- }
-}
diff --git a/SampleWebApp/Properties/Settings.settings b/SampleWebApp/Properties/Settings.settings
deleted file mode 100644
index cd30221..0000000
--- a/SampleWebApp/Properties/Settings.settings
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
- LocalHost
-
-
- jonsmith_
-
-
-
\ No newline at end of file
diff --git a/SampleWebApp/SampleWebApp.csproj b/SampleWebApp/SampleWebApp.csproj
index eca4d77..f09cf7d 100644
--- a/SampleWebApp/SampleWebApp.csproj
+++ b/SampleWebApp/SampleWebApp.csproj
@@ -1,485 +1,19 @@
-
-
-
+
+
- Debug
- AnyCPU
-
-
- 2.0
- {CFFEE5E0-3B99-46E0-9A82-2E74621C17C5}
- {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
- Library
- Properties
+ net8.0
+ disable
+ disable
SampleWebApp
SampleWebApp
- v4.5.1
- false
- true
-
-
-
-
-
-
- true
- full
- false
- bin\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\
- TRACE
- prompt
- 4
-
-
-
- False
- ..\packages\Autofac.3.5.0\lib\net40\Autofac.dll
-
-
- False
- ..\packages\Autofac.Mvc5.3.3.1\lib\net45\Autofac.Integration.Mvc.dll
-
-
- ..\packages\AutoMapper.4.2.1\lib\net45\AutoMapper.dll
- True
-
-
- ..\packages\DelegateDecompiler.0.18.0\lib\net40-Client\DelegateDecompiler.dll
- True
-
-
- ..\packages\DelegateDecompiler.EntityFramework.0.18.0\lib\net45\DelegateDecompiler.EntityFramework.dll
- True
-
-
- ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll
- True
-
-
- ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll
- True
-
-
- ..\packages\GenericLibsBase.1.0.1\lib\GenericLibsBase.dll
- True
-
-
- ..\packages\GenericServices.1.0.9\lib\GenericServices.dll
- True
-
-
- ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll
-
-
- False
- ..\packages\Microsoft.AspNet.Identity.Core.2.1.0\lib\net45\Microsoft.AspNet.Identity.Core.dll
-
-
- False
- ..\packages\Microsoft.AspNet.Identity.EntityFramework.2.1.0\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll
-
-
- False
- ..\packages\Microsoft.AspNet.Identity.Owin.2.1.0\lib\net45\Microsoft.AspNet.Identity.Owin.dll
-
-
- ..\packages\Microsoft.AspNet.SignalR.Core.2.0.3\lib\net45\Microsoft.AspNet.SignalR.Core.dll
-
-
- ..\packages\Microsoft.AspNet.SignalR.SystemWeb.2.0.3\lib\net45\Microsoft.AspNet.SignalR.SystemWeb.dll
- True
-
-
-
- False
- ..\packages\Microsoft.Owin.3.0.0\lib\net45\Microsoft.Owin.dll
-
-
- False
- ..\packages\Microsoft.Owin.Security.3.0.0\lib\net45\Microsoft.Owin.Security.dll
-
-
- False
- ..\packages\Microsoft.Owin.Security.Cookies.3.0.0\lib\net45\Microsoft.Owin.Security.Cookies.dll
-
-
- False
- ..\packages\Microsoft.Owin.Security.Facebook.3.0.0\lib\net45\Microsoft.Owin.Security.Facebook.dll
-
-
- False
- ..\packages\Microsoft.Owin.Security.Google.3.0.0\lib\net45\Microsoft.Owin.Security.Google.dll
-
-
- False
- ..\packages\Microsoft.Owin.Security.MicrosoftAccount.3.0.0\lib\net45\Microsoft.Owin.Security.MicrosoftAccount.dll
-
-
- False
- ..\packages\Microsoft.Owin.Security.OAuth.3.0.0\lib\net45\Microsoft.Owin.Security.OAuth.dll
-
-
- ..\packages\Mono.Reflection.1.0.0.0\lib\Mono.Reflection.dll
-
-
- False
- ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll
-
-
-
-
-
-
-
-
-
-
-
- False
- ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll
-
-
- False
- ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll
-
-
- False
- ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll
-
-
- False
- ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll
-
-
- False
- ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll
-
-
- False
- ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll
-
-
-
-
-
-
-
-
-
-
-
- True
- ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
-
-
-
-
-
-
- ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll
-
-
- True
- ..\packages\WebGrease.1.5.2\lib\WebGrease.dll
-
-
- True
- ..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll
-
-
-
-
- ..\packages\Owin.1.0\lib\net40\Owin.dll
-
-
- ..\packages\Microsoft.Owin.Host.SystemWeb.2.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll
-
-
- ..\packages\Microsoft.Owin.Security.Twitter.2.1.0\lib\net45\Microsoft.Owin.Security.Twitter.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
- Global.asax
-
-
-
-
-
-
-
-
-
-
- True
- True
- Settings.settings
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Designer
-
-
- Web.config
-
-
- Web.config
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Web.config
-
-
- Web.config
-
-
+
-
-
+
+
+
+
+
-
-
-
-
-
-
- {264e1878-12de-4099-b8d7-cc53a73fea49}
- DataLayer
-
-
- {d2813927-0f38-43c3-b47c-ae8f00d50cae}
- ServiceLayer
-
-
-
- 10.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
- bin\
- TRACE
- true
- pdbonly
- AnyCPU
- prompt
- MinimumRecommendedRules.ruleset
-
-
- bin\
- TRACE
- true
- pdbonly
- AnyCPU
- prompt
- MinimumRecommendedRules.ruleset
-
-
- bin\
- TRACE
- true
- pdbonly
- AnyCPU
- prompt
- MinimumRecommendedRules.ruleset
-
-
-
-
-
-
-
-
-
-
-
- True
- True
- 50623
- /
- http://localhost:50623/
- False
- False
-
-
- False
-
-
-
-
-
-
\ No newline at end of file
+
+
diff --git a/SampleWebApp/Views/Blogs/Index.cshtml b/SampleWebApp/Views/Blogs/Index.cshtml
index 98bb41d..e334799 100644
--- a/SampleWebApp/Views/Blogs/Index.cshtml
+++ b/SampleWebApp/Views/Blogs/Index.cshtml
@@ -9,7 +9,7 @@
}
@if (TempData["errorMessage"] != null)
{
- @TempData["errorMessage"]
+ @Html.Raw(TempData["errorMessage"])
}
diff --git a/SampleWebApp/Views/Posts/Create.cshtml b/SampleWebApp/Views/Posts/Create.cshtml
index ca33689..d847642 100644
--- a/SampleWebApp/Views/Posts/Create.cshtml
+++ b/SampleWebApp/Views/Posts/Create.cshtml
@@ -39,7 +39,7 @@
- @Html.Label("Tags", htmlAttributes: new { @class = "control-label col-md-2" })
+ @Html.Label("Tags", "Tags", htmlAttributes: new { @class = "control-label col-md-2" })
@Html.EditorFor(model => model.UserChosenTags, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.UserChosenTags, "", new { @class = "text-danger" })
@@ -60,8 +60,9 @@
@Html.ActionLink("Back to List", "Index")
-@Html.Partial("PostValidation")
+
@section Scripts {
- @Scripts.Render("~/bundles/jqueryval")
+
+
}
diff --git a/SampleWebApp/Views/PostsAsync/Index.cshtml b/SampleWebApp/Views/PostsAsync/Index.cshtml
index 706400f..a04efa0 100644
--- a/SampleWebApp/Views/PostsAsync/Index.cshtml
+++ b/SampleWebApp/Views/PostsAsync/Index.cshtml
@@ -12,7 +12,7 @@
}
@if (TempData["errorMessage"] != null)
{
-
@TempData["errorMessage"]
+
@Html.Raw(TempData["errorMessage"])
}
diff --git a/SampleWebApp/Views/Shared/Error.cshtml b/SampleWebApp/Views/Shared/Error.cshtml
index be55b17..61bf998 100644
--- a/SampleWebApp/Views/Shared/Error.cshtml
+++ b/SampleWebApp/Views/Shared/Error.cshtml
@@ -1,9 +1,6 @@
-@model System.Web.Mvc.HandleErrorInfo
-
@{
ViewBag.Title = "Error";
}
Error.
An error occurred while processing your request.
-
diff --git a/SampleWebApp/Views/Shared/_Layout.cshtml b/SampleWebApp/Views/Shared/_Layout.cshtml
index 345fd91..0f327cc 100644
--- a/SampleWebApp/Views/Shared/_Layout.cshtml
+++ b/SampleWebApp/Views/Shared/_Layout.cshtml
@@ -5,7 +5,8 @@
@ViewBag.Title - SampleMvcWebApp
- @Styles.Render("~/Content/css")
+
+
@@ -54,7 +55,9 @@
- @Scripts.Render("~/bundles/javascript")
- @RenderSection("scripts", required: false)
+
+
+
+ @await RenderSectionAsync("scripts", required: false)