Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 3965

How to share models between ASP.NET Web API and Blazor applications?

$
0
0

I'm currently in the process of migrating an ASP.NET MVC project to Blazor, and I'm seeking advice on the best approach for sharing data models between my ASP.NET Web API project and the new Blazor client application.

In my existing ASP.NET Web API project, I have defined several data models (Manga, MangaChapterViewModel, etc.) for interacting with the database. As part of the migration process, I want to reuse these models on the client side within my Blazor application without duplicating them.

I'm considering whether to create a separate class library project to store these shared models or if there's a better approach available. Additionally, I'm interested in understanding how to handle data serialization/deserialization, loading data via HTTP requests, and managing the data models on the client side within a Blazor context.

I would greatly appreciate it if anyone has experience with a similar migration scenario or can provide advice, examples, or best practices. Thank you!


Viewing all articles
Browse latest Browse all 3965

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>