add color to ISection

This commit is contained in:
2020-04-05 00:39:12 +02:00
parent ceb060343f
commit 44a3e61112
10 changed files with 56 additions and 9 deletions
@@ -0,0 +1,32 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using zero.Core;
using zero.Web.Sections;
namespace zero.Web
{
public static class ZeroServiceCollectionExtensions
{
public static ZeroBuilder AddZero(this IServiceCollection services)
{
services.AddOptions<ZeroOptions>()
.Configure(opts =>
{
opts.Sections.Add<DashboardSection>();
opts.Sections.Add<PagesSection>();
opts.Sections.Add<ListsSection>();
opts.Sections.Add<MediaSection>();
opts.Sections.Add<SettingsSection>();
});
return new ZeroBuilder(services);
}
public static ZeroBuilder AddZero(this IServiceCollection services, Action<ZeroOptions> setupAction)
{
ZeroBuilder builder = services.AddZero();
builder.Services.PostConfigure(setupAction);
return builder;
}
}
}