YAFNET.RazorPages 4.0.0-rc04

This is a prerelease version of YAFNET.RazorPages.
dotnet add package YAFNET.RazorPages --version 4.0.0-rc04                
NuGet\Install-Package YAFNET.RazorPages -Version 4.0.0-rc04                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="YAFNET.RazorPages" Version="4.0.0-rc04" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add YAFNET.RazorPages --version 4.0.0-rc04                
#r "nuget: YAFNET.RazorPages, 4.0.0-rc04"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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                

YAFLogo

YAF.NET Razor Pages Client Library

Prerequisites:

  • ASP.NET Core 9.0 (YAF v4.x)

Quick Guide

Add the YAF Nuget Packages

  1. Install the YAFNET.RazorPages Package via Nuget Browser or the console

NuGet

> dotnet add package YAFNET.RazorPages
  1. Depending on which Data Provider you want top use add the package ..

YAFNET.Data.SqlServer Package via Nuget Browser or the console

NuGet

> dotnet add package YAFNET.Data.SqlServer

YAF.Data.MySQL Package via Nuget Browser or the console

NuGet

> dotnet add package YAFNET.Data.MySQL

YAFNET.Data.PostgreSQL Package via Nuget Browser or the console

NuGet

> dotnet add package YAFNET.Data.PostgreSQL

YAFNET.Data.Sqlite Package via Nuget Browser or the console

NuGet

> 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 Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 164 11/17/2024
4.0.0-rc03 437 7/6/2024
4.0.0-rc02 157 5/29/2024
4.0.0-rc01 93 5/29/2024
4.0.0-beta09 90 5/18/2024
4.0.0-beta07 133 3/28/2024
4.0.0-beta05 124 2/28/2024