問題タブ [asp.net-blazor]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
225 参照

blazor - Blazor Wasm の読み込み時に API からフェッチされた引用を表示する方法 (つまり、画面の読み込み時)?

blazor wasm アプリの読み込み時に引用符を表示したいと考えています。この msg クラスにアクセスする方法。スクリプトを index.html ヘッダー タグに入れました。しかし、これにアクセスできませんか?

方法はありますか???

0 投票する
1 に答える
965 参照

asp.net - ASP.net Blazor: Display data from two or more related tables

https://www.youtube.com/watch?v=UBNRcaw1bDk&list=PL6n9fhu94yhVowClAs8-6nYnfsOTma14P&index=23

Hi I'm trying to implement project as mentioned in above link. I'm trying get data from ASP.NET WebAPI project and consume in Blazor project. I have no issue retrieving data from single table. But when I try to retrieve data from Secondary table . I'm getting error below:

"HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error)."

I tried casting the result (in API project)explicitly to 'Employee' class before sending. Didn't work. Debug on API clearly shows returning Employee with Department information but on Blazor project while receiving getting error. Thanks in advance!!

UPDATE:

Thank you all for offering help. Here is the original code.

Update : Thanks all for response. Department is mandatory.So there is no chance of null. This is the only solution that worked. I have created another Viewmodel in Blazor project that has all fields same as Employee and Initialized Department inside ViewModelClass. Then I was able to show Employee.Department.DepartmentName in UI.