Good afternoon everyone,
I've been trying the IDE for the first time and I'm near to complete the first steps in a blazor app (https://www.radzen.com/documentation/blazor/crm/finishing-touches/)
When I was changing the Profile page it shows me an error that I can't understand what the problem is
Exception:
https://paste.ofcode.org/tMmFzmq7hAkmmuNB9Th7CK (razor code)
Code:
using System;
using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.JSInterop;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Radzen;
using Radzen.Blazor;
using RadzenProject.Models.DAAppPoEngine;
using Microsoft.AspNetCore.Identity;
using RadzenProject.Models;
using RadzenProject.Client.Pages;
namespace RadzenProject.Pages
{
public partial class ProfileComponent : ComponentBase
{
[Parameter(CaptureUnmatchedValues = true)]
public IReadOnlyDictionary<string, dynamic> Attributes { get; set; }
public void Reload()
{
InvokeAsync(StateHasChanged);
}
public void OnPropertyChanged(PropertyChangedEventArgs args)
{
}
[Inject]
protected IJSRuntime JSRuntime { get; set; }
[Inject]
protected NavigationManager UriHelper { get; set; }
[Inject]
protected DialogService DialogService { get; set; }
[Inject]
protected TooltipService TooltipService { get; set; }
[Inject]
protected ContextMenuService ContextMenuService { get; set; }
[Inject]
protected NotificationService NotificationService { get; set; }
[Inject]
protected SecurityService Security { get; set; }
[Inject]
protected DAAppPoEngineService DAAppPoEngine { get; set; }
ApplicationUser _user;
protected ApplicationUser user
{
get
{
return _user;
}
set
{
if (!object.Equals(_user, value))
{
var args = new PropertyChangedEventArgs(){ Name = "user", NewValue = value, OldValue = _user };
_user = value;
OnPropertyChanged(args);
Reload();
}
}
}
protected override async System.Threading.Tasks.Task OnInitializedAsync()
{
if (!await Security.IsAuthenticatedAsync())
{
UriHelper.NavigateTo("Login", true);
}
else
{
await Load();
}
}
protected async System.Threading.Tasks.Task Load()
{
if (Security.User != null)
{
var securityGetUserByIdResult = await Security.GetUserById($"{Security.User.Id}");
user = securityGetUserByIdResult;
}
}
protected async System.Threading.Tasks.Task TemplateForm0Submit(RadzenProject.Models.ApplicationUser args)
{
var securityUpdateUserResult = await Security.UpdateUser($"{Security.User.Id}", user);
NotificationService.Notify(NotificationSeverity.Success, $"Success", $"Personal data updated successfully!");
}
protected async System.Threading.Tasks.Task Button1Click(MouseEventArgs args)
{
DialogService.Close();
await JSRuntime.InvokeAsync<string>("window.history.back");
}
}
}
Can someone check what am I missing?
Thanks in advance