CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.Blazor/ConfigurationExtensions.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="BlazorConfigurationExtensions.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Implement extension methods for .NET Core configuration</summary>
7//-----------------------------------------------------------------------
8using Csla.Blazor;
9using Microsoft.AspNetCore.Authorization;
10using Microsoft.Extensions.DependencyInjection.Extensions;
11
12namespace Csla.Configuration
13{
17 public static class BlazorConfigurationExtensions
18 {
24 public static ICslaBuilder WithBlazorServerSupport(this ICslaBuilder builder)
25 {
26 builder.Services.TryAddTransient(typeof(ViewModel<>), typeof(ViewModel<>));
27 builder.Services.TryAddSingleton<IAuthorizationPolicyProvider, CslaPermissionsPolicyProvider>();
28 builder.Services.TryAddSingleton<IAuthorizationHandler, CslaPermissionsHandler>();
29 return builder;
30 }
31 }
32}
Authorization handler for CSLA permissions.
Base type for creating your own viewmodel.