blazor

上周热点回顾(12.16-12.22)

百般思念 提交于 2021-02-15 11:09:01
热点随笔: · 超燃| 2019 中国.NET 开发者峰会视频发布 ( 张善友 ) · 我在华为做外包的真实经历! ( 纯洁的微笑 ) · 我采访了同事,让他掏出了每天都会浏览的干货网站... ( Java3y ) · ASP.NET Core Web API 最佳实践指南 ( hippieZhou ) · C#异步编程入门看这篇就够了 ( 依乐祝 ) · 我是技术总监,我出来求职,竟然找不到工作! ( 码农突围 ) · 程序员的遮羞布:这个需求技术上无法实现 ( 沉默王二 ) · 默认浏览器争霸传奇 ( 轩辕之风 ) · 《程序人生》2020无畏年少青春,迎风潇洒前行,程序员2019的心路历程,披荆斩棘,雨过天晴 ( 敖丙 ) · 微服务的时间和成本去哪儿了 ( 张飞洪[厦门] ) · 基于 Blazui 的 Blazor 后台管理模板 BlazAdmin 正式尝鲜 ( 馨辰 ) · k8s 开船记:升级为豪华邮轮(高可用集群)与遇到奇怪故障(dns解析异常) ( 博客园团队 ) 热点新闻: · 李子柒一年能赚多少钱,数据量化给你看 · 三星关闭昆山工厂!员工赔偿N+5! · 人造水塘是怎么凭空“长”出鱼来的?这部纪录片用镜头记录了全过程 · 小米武汉总部开园 雷军:感受到光谷速度 我们人员破2000人 · 雷军知天命 · 魁北克发明新式斑马线!能秒变一堵墙,比红绿灯还管用! ·

Blazor WebAssembly Monitor Threading exception

南楼画角 提交于 2021-02-11 17:05:39
问题 I'm currently working on a .NET Standard 2.1 Blazor WebAssembly hosted application. My application structure looks like this: BlazorApp.Client (error occures here) BlazorApp.Server I use Serilog with the Elasticsearch sink in my BlazorApp.Client project. It works fine, but when I enable Selflog on Serilog and debug, I get the following error in my browser console: SelfLog.Enable(msg => Debug.WriteLine(msg)); Elasticsearch.Net.UnexpectedElasticsearchClientException: Cannot wait on monitors on

Blazor WebAssembly Monitor Threading exception

人盡茶涼 提交于 2021-02-11 17:04:35
问题 I'm currently working on a .NET Standard 2.1 Blazor WebAssembly hosted application. My application structure looks like this: BlazorApp.Client (error occures here) BlazorApp.Server I use Serilog with the Elasticsearch sink in my BlazorApp.Client project. It works fine, but when I enable Selflog on Serilog and debug, I get the following error in my browser console: SelfLog.Enable(msg => Debug.WriteLine(msg)); Elasticsearch.Net.UnexpectedElasticsearchClientException: Cannot wait on monitors on

How to get fresh information whether the user is logged in?

删除回忆录丶 提交于 2021-02-11 16:58:40
问题 In this particular case I am only interested in getting info whether the user is logged in or not. Following the answers How to enable/disable elements depending whether the user is logged in or not? I can fetch this information but there is one odd problem. I use Blazor demo app which displays provided "LoginDisplay.razor" component at top, my own page uses following code: @code { protected override async Task OnInitializedAsync() { Console.WriteLine("Init"); var authState = await

How to get fresh information whether the user is logged in?

末鹿安然 提交于 2021-02-11 16:57:54
问题 In this particular case I am only interested in getting info whether the user is logged in or not. Following the answers How to enable/disable elements depending whether the user is logged in or not? I can fetch this information but there is one odd problem. I use Blazor demo app which displays provided "LoginDisplay.razor" component at top, my own page uses following code: @code { protected override async Task OnInitializedAsync() { Console.WriteLine("Init"); var authState = await

Blazor component needs to modify value of parent component

本小妞迷上赌 提交于 2021-02-11 15:41:07
问题 I have these two components in my Blazor app: Component1.razor: <CascadingValue Value=this> <Component2/> </CascadingValue> <p>@DisplayedText</p> @code { public string DisplayedText = string.Empty; } Component2.razor: <button @onclick=@(e => { C1.DisplayedText = "testing"; })>Set DisplayedText</button> @code { [CascadingParameter] public Component1 C1 { get; set; } } When I click the "Set DisplayedText" button, the text in the p element in Component1 should change to testing , but it does not

how to use usermanager on a blazor page?

五迷三道 提交于 2021-02-11 07:01:29
问题 hello community I have a question how can I use usermanager in a blazor page webassembly ? by injecting this: @inject UserManager<ApplicationUser> UserManager; I get the indication that a usage directive is missing as the class the ApplicationUser class is on the server and the client does not have access to the server. this is my code in blazor page: @page "/index" @inject AuthenticationStateProvider AuthenticationStateProvider @using Microsoft.AspNetCore.Identity; @inject UserManager

how to use usermanager on a blazor page?

夙愿已清 提交于 2021-02-11 07:00:30
问题 hello community I have a question how can I use usermanager in a blazor page webassembly ? by injecting this: @inject UserManager<ApplicationUser> UserManager; I get the indication that a usage directive is missing as the class the ApplicationUser class is on the server and the client does not have access to the server. this is my code in blazor page: @page "/index" @inject AuthenticationStateProvider AuthenticationStateProvider @using Microsoft.AspNetCore.Identity; @inject UserManager

how to persist value in a singleton state container in blazor web assembly on page reload

末鹿安然 提交于 2021-02-10 23:17:36
问题 I practicing and learning blazor web assembly . I'm learning on the ways to communicate between the components. One such way is to use a state container. This works as expected however it does not sustain value on page refresh. Here is my state container class, AppState : public class AppState { public string SomeText { get; set; } } I have registered this as a Singleton instance in Program.cs builder.Services.AddSingleton<AppState>(); with this setup, I'm able to @inject AppState in multiple

how to persist value in a singleton state container in blazor web assembly on page reload

◇◆丶佛笑我妖孽 提交于 2021-02-10 23:17:32
问题 I practicing and learning blazor web assembly . I'm learning on the ways to communicate between the components. One such way is to use a state container. This works as expected however it does not sustain value on page refresh. Here is my state container class, AppState : public class AppState { public string SomeText { get; set; } } I have registered this as a Singleton instance in Program.cs builder.Services.AddSingleton<AppState>(); with this setup, I'm able to @inject AppState in multiple