Skip to content

Instantly share code, notes, and snippets.

@sitefinitySDK
Created October 25, 2024 23:18
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Renderer.Models;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Progress.Sitefinity.AspNetCore;
using Progress.Sitefinity.AspNetCore.ViewComponents;
using Progress.Sitefinity.AspNetCore.FormWidgets;
using Progress.Sitefinity.AspNetCore.Widgets.Models.ContentBlock;
using Renderer.Entities;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddSitefinity();
builder.Services.AddViewComponentModels();
builder.Services.AddFormViewComponentModels();
builder.Services.AddScoped<IContentBlockModel, ExtendedContentBlockModel>();
builder.Services.AddSingleton<IEntityExtender, EntityExtender<ContentBlockEntity, ExtendedContentBlockEntity>>();
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