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.
CslaValidator.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Text;
4using Microsoft.AspNetCore.Components;
5using Microsoft.AspNetCore.Components.Forms;
6
7namespace Csla.Blazor
8{
9
14 public class CslaValidator : ComponentBase
15 {
16
20 [CascadingParameter]
21 public EditContext CurrentEditContext { get; set; }
22
26 protected override void OnInitialized()
27 {
28 // Check that the EditContext parameter has been made available
29 if (CurrentEditContext == null)
30 {
31 // No cascading parameter is available; we are probably not inside an EditForm component
32 throw new InvalidOperationException(
34 nameof(CslaValidator), nameof(EditContext)));
35 }
36
37 // Wire up validation to the context we have been provided
38 CurrentEditContext.AddCslaValidation();
39 }
40 }
41}
Class offering integration of CSLA validation into Blazor edit forms This is a component with no visi...
override void OnInitialized()
Override to do work after initialization
EditContext CurrentEditContext
Gets or sets the current edit context for the component
A strongly-typed resource class, for looking up localized strings, etc.
static string CascadingEditContextRequiredException
Looks up a localized string similar to {0} requires a cascading parameter of type {1}.