Hi all,
I have just added IdentityServer4 support to my Blazor app.
All was working fine, but now I cannot Save an update in the DataGrid.
The first few lines of the actual error I'm receiving are:
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Value cannot be null.
Parameter name: propertyName
at System.ComponentModel.DataAnnotations.ValidationAttributeStore+TypeStoreItem.TryGetPropertyStoreItem (System.String propertyName, System.ComponentModel.DataAnnotations.ValidationAttributeStore+PropertyStoreItem& item) <0x665c4d8 + 0x0001c> in <filename unknown>:0
at System.ComponentModel.DataAnnotations.ValidationAttributeStore+TypeStoreItem.GetPropertyStoreItem (System.String propertyName) <0x665c348 + 0x00012> in <filename unknown>:0
at System.ComponentModel.DataAnnotations.ValidationAttributeStore.GetPropertyType (System.ComponentModel.DataAnnotations.ValidationContext validationContext) <0x6654760 + 0x00032> in <filename unknown>:0
at System.ComponentModel.DataAnnotations.Validator.TryValidateProperty (System.Object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext, System.Collections.Generic.ICollection`1[T] validationResults) <0x6654350 + 0x00010> in <filename unknown>:0
at Syncfusion.Blazor.Grids.Internal.Editors.ColumnsValidator`1[T].DataAnnotationHandler (Microsoft.AspNetCore.Components.Forms.FieldIdentifier identifier) <0x669d230 + 0x000b2> in <filename unknown>:0
at Syncfusion.Blazor.Grids.Internal.Editors.ColumnsValidator`1[T].ValidateRequested (System.Object editContext, Microsoft.AspNetCore.Components.Forms.ValidationRequestedEventArgs validationEventArgs) <0x66e1c68 + 0x00088> in <filename unknown>:0
I believe that the only change I have made (apart from the changes relating to IdentityServer4) was to change the Class of "ApplicationDbContext" to the following:
public class ApplicationDbContext : ApiAuthorizationDbContext<ApplicationUser>
{
public ApplicationDbContext(
DbContextOptions options,
IOptions<OperationalStoreOptions> operationalStoreOptions) : base(options, operationalStoreOptions)
{
}
i.e. adding "ApiAuthorizationDbContext<ApplicationUser>" & the line beginning "IOptions..."
I have, so far, only added "AuthorizeView" to the actual Pages (i.e. NOT to the Controllers). Attached is an example of the "Language" DataGrid.
Any help would be greatly appreciated as this error seems to be occurring within the DataGrid itself?
Simon
Attachment:
Language_679676b7.7z