Created
October 25, 2024 23:18
-
-
Save sitefinitySDK/1fbe69f2d0e00609348f243347cb9b0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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