YAFNET.RazorPages 4.0.0-rc01

This is a prerelease version of YAFNET.RazorPages.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package YAFNET.RazorPages --version 4.0.0-rc01                
NuGet\Install-Package YAFNET.RazorPages -Version 4.0.0-rc01                
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-rc01" />                
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-rc01                
#r "nuget: YAFNET.RazorPages, 4.0.0-rc01"                
#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-rc01&prerelease

// Install YAFNET.RazorPages as a Cake Tool
#tool nuget:?package=YAFNET.RazorPages&version=4.0.0-rc01&prerelease                

YAFLogo

YAF.NET Razor Pages Client Library

Prerequisites:

  • ASP.NET Core 8.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://forum.yetanotherforum.net. 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://forum.yetanotherforum.net, or visit the Wiki for More Informations.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
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-rc03 310 7/6/2024
4.0.0-rc02 146 5/29/2024
4.0.0-rc01 82 5/29/2024
4.0.0-beta09 74 5/18/2024
4.0.0-beta07 122 3/28/2024
4.0.0-beta05 109 2/28/2024