YAFNET.RazorPages
4.0.0-rc04
dotnet add package YAFNET.RazorPages --version 4.0.0-rc04
NuGet\Install-Package YAFNET.RazorPages -Version 4.0.0-rc04
<PackageReference Include="YAFNET.RazorPages" Version="4.0.0-rc04" />
paket add YAFNET.RazorPages --version 4.0.0-rc04
#r "nuget: YAFNET.RazorPages, 4.0.0-rc04"
// Install YAFNET.RazorPages as a Cake Addin #addin nuget:?package=YAFNET.RazorPages&version=4.0.0-rc04&prerelease // Install YAFNET.RazorPages as a Cake Tool #tool nuget:?package=YAFNET.RazorPages&version=4.0.0-rc04&prerelease
YAF.NET Razor Pages Client Library
Prerequisites:
- ASP.NET Core 9.0 (YAF v4.x)
Quick Guide
Add the YAF Nuget Packages
- Install the YAFNET.RazorPages Package via Nuget Browser or the console
> dotnet add package YAFNET.RazorPages
- Depending on which Data Provider you want top use add the package ..
YAFNET.Data.SqlServer Package via Nuget Browser or the console
> dotnet add package YAFNET.Data.SqlServer
YAF.Data.MySQL Package via Nuget Browser or the console
> dotnet add package YAFNET.Data.MySQL
YAFNET.Data.PostgreSQL Package via Nuget Browser or the console
> dotnet add package YAFNET.Data.PostgreSQL
YAFNET.Data.Sqlite Package via Nuget Browser or the console
> dotnet add package YAFNET.Data.Sqlite
Getting Started
Program.cs
In the Program.cs
add UseAutofacServiceProviderFactory
and ConfigureYafLogging
to the IHostBuilder
.
var host = Host.CreateDefaultBuilder(args).UseAutofacServiceProviderFactory()
.ConfigureYafLogging()
.ConfigureWebHostDefaults(webHostBuilder => webHostBuilder.UseStartup<Startup>()).Build();
return host.RunAsync();
Startup.cs
You add the YAF.NET services and the YAF.NET UI in the Startup.cs of your application.
public void ConfigureServices(IServiceCollection services)
{
...
services.AddRazorPages(options =>
{
options.Conventions.AddPageRoute("/SiteMap", "Sitemap.xml");
}).AddYafRazorPages(this.Environment);
services.AddYafCore(this.Configuration);
...
}
/// <summary>
/// Configures the container.
/// </summary>
/// <param name="builder">The builder.</param>
public void ConfigureContainer(ContainerBuilder builder)
{
builder.RegisterYafModules();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.RegisterAutofac();
app.UseAntiXssMiddleware();
app.UseStaticFiles();
app.UseSession();
app.UseYafCore(this.ServiceLocator, env);
app.UseEndpoints(endpoints =>
{
endpoints.MapRazorPages();
endpoints.MapAreaControllerRoute(
name: "default",
areaName:"Forums",
pattern: "{controller=Home}/{action=Index}/{id?}");
endpoints.MapControllers();
endpoints.MapYafHubs();
});
...
}
Now the Forum is ready and you can add a link to your _Layout.cshtml
<li class="nav-item">
<a class="nav-link" asp-area="Forums" asp-page="/Index">Forums</a>
</li>
Community Support Forum
See a real live YAF Forum by visiting the YetAnotherForum.NET community support forum: https://yetanotherforum.net/forums. Also, get your questions answered by the YAF community.
License
Yet Another Forum.NET is licensed under the Apache 2.0 license.
Yet Another Forum Community Support
If you have any questions, please visit the YAF Community Support forum: https://yetanotherforum.net/forums, or visit the Wiki for More Informations.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. |
-
net9.0
- HtmlProperties (>= 1.0.0)
- Microsoft.AspNetCore.Authentication.Facebook (>= 9.0.0)
- Microsoft.AspNetCore.Authentication.Google (>= 9.0.0)
- Microsoft.AspNetCore.Identity.UI (>= 9.0.0)
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 9.0.0)
- Microsoft.Extensions.FileProviders.Embedded (>= 9.0.0)
- YAFNET.Core (>= 4.0.0-rc04)
- YAFNET.Types (>= 4.0.0-rc04)
- YAFNET.Web (>= 4.0.0-rc04)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
4.0.0-rc04 | 96 | 11/17/2024 |
4.0.0-rc03 | 363 | 7/6/2024 |
4.0.0-rc02 | 153 | 5/29/2024 |
4.0.0-rc01 | 89 | 5/29/2024 |
4.0.0-beta09 | 86 | 5/18/2024 |
4.0.0-beta07 | 133 | 3/28/2024 |
4.0.0-beta05 | 120 | 2/28/2024 |