diff --git a/Examples/website/FreeSql.Site.UI/Areas/BBS/_ViewStart.cshtml b/Examples/website/FreeSql.Site.UI/Areas/BBS/_ViewStart.cshtml new file mode 100644 index 00000000..2de62418 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/BBS/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} diff --git a/Examples/website/FreeSql.Site.UI/Areas/Doc/Controllers/DocumentsController.cs b/Examples/website/FreeSql.Site.UI/Areas/Doc/Controllers/DocumentsController.cs index 7540ae86..f63c6f2d 100644 --- a/Examples/website/FreeSql.Site.UI/Areas/Doc/Controllers/DocumentsController.cs +++ b/Examples/website/FreeSql.Site.UI/Areas/Doc/Controllers/DocumentsController.cs @@ -12,7 +12,7 @@ namespace FreeSql.Site.UI.Areas.Doc.Controllers public class DocumentsController : BaseController { // GET: Documents - public ActionResult Index() + public IActionResult Index() { return View(); } diff --git a/Examples/website/FreeSql.Site.UI/Areas/Doc/Views/Documents/Index.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Doc/Views/Documents/Index.cshtml index b01e239b..0bfed646 100644 --- a/Examples/website/FreeSql.Site.UI/Areas/Doc/Views/Documents/Index.cshtml +++ b/Examples/website/FreeSql.Site.UI/Areas/Doc/Views/Documents/Index.cshtml @@ -1,4 +1,8 @@ @* For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 *@ +@using Microsoft.AspNetCore.Routing; +@using Microsoft.AspNetCore.Mvc; + + 文档首页 \ No newline at end of file diff --git a/Examples/website/FreeSql.Site.UI/Areas/Doc/_ViewStart.cshtml b/Examples/website/FreeSql.Site.UI/Areas/Doc/_ViewStart.cshtml new file mode 100644 index 00000000..2de62418 --- /dev/null +++ b/Examples/website/FreeSql.Site.UI/Areas/Doc/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} diff --git a/Examples/website/FreeSql.Site.UI/FreeSql.Site.UI.csproj b/Examples/website/FreeSql.Site.UI/FreeSql.Site.UI.csproj index 8b11fc59..c0b83ea4 100644 --- a/Examples/website/FreeSql.Site.UI/FreeSql.Site.UI.csproj +++ b/Examples/website/FreeSql.Site.UI/FreeSql.Site.UI.csproj @@ -18,4 +18,13 @@ + + + $(IncludeRazorContentInPack) + + + $(IncludeRazorContentInPack) + + + diff --git a/Examples/website/FreeSql.Site.UI/Startup.cs b/Examples/website/FreeSql.Site.UI/Startup.cs index 07f7585d..9e6faa3d 100644 --- a/Examples/website/FreeSql.Site.UI/Startup.cs +++ b/Examples/website/FreeSql.Site.UI/Startup.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Newtonsoft.Json.Serialization; namespace FreeSql.Site.UI { @@ -32,6 +33,21 @@ namespace FreeSql.Site.UI }); + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1) + //设置返回内容得大小写格式 + .AddJsonOptions(options => { options.SerializerSettings.ContractResolver = new DefaultContractResolver(); }); + + //Session服务 + services.AddSession(); + + //添加跨域访问 + services.AddCors(options => options.AddPolicy("AllowAnyOrigin", + builder => builder.WithOrigins("*") + .AllowAnyMethod() + .AllowAnyHeader() + .AllowAnyOrigin() + .AllowCredentials())); + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); } diff --git a/Examples/website/FreeSql.Site.UI/Views/Home/Index.cshtml b/Examples/website/FreeSql.Site.UI/Views/Home/Index.cshtml index a3f9ac59..32b58efc 100644 --- a/Examples/website/FreeSql.Site.UI/Views/Home/Index.cshtml +++ b/Examples/website/FreeSql.Site.UI/Views/Home/Index.cshtml @@ -3,7 +3,7 @@ }
-
+
diff --git a/Examples/website/FreeSql.Site.UI/Views/Shared/_Layout.cshtml b/Examples/website/FreeSql.Site.UI/Views/Shared/_Layout.cshtml index 53efb280..fb71e34c 100644 --- a/Examples/website/FreeSql.Site.UI/Views/Shared/_Layout.cshtml +++ b/Examples/website/FreeSql.Site.UI/Views/Shared/_Layout.cshtml @@ -122,7 +122,7 @@
  • - 文档 + 文档
  • 示例 diff --git a/Examples/website/FreeSql.Site.UI/wwwroot/images/banner_index.jpg b/Examples/website/FreeSql.Site.UI/wwwroot/images/banner_index.jpg new file mode 100644 index 00000000..21648af9 Binary files /dev/null and b/Examples/website/FreeSql.Site.UI/wwwroot/images/banner_index.jpg differ