Skip to content

Instantly share code, notes, and snippets.

@sitefinitySDK
Created September 8, 2024 12:11
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Progress.Sitefinity.AspNetCore;
using Progress.Sitefinity.AspNetCore.FormWidgets;
using Progress.Sitefinity.AspNetCore.Preparations;
using Progress.Sitefinity.Renderer.Designers;
using share_data_between_widgets;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddSitefinity();
builder.Services.AddViewComponentModels();
builder.Services.AddSingleton<IRequestPreparation, CategoryPreparation>();
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseStaticFiles();
app.UseRouting();
app.UseSitefinity();
app.Run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment