Last post Oct 30, 2019 01:51 PM by Mikesdotnetting
Oct 30, 2019 05:46 AM|KarthickP|LINK
How i will create model class and DB context class in blazor application. can create Model and DB context class support Blazor client, Server and hosted project?
Please help me on this.
Oct 30, 2019 07:06 AM|Mikesdotnetting|LINK
If you create a WebAssembly project, make sure that you keep the ASP.NET Hosted option selected:
This generates 3 projects: Client, Server and Shared. You can generate put your model and context classes in the Shared project, a class library that is referenced by both the client and server projects. The server project should include Web API controllers
that make data available, and the client project should use the HttpClient to make calls to the Web API controller methods.
Oct 30, 2019 09:14 AM|KarthickP|LINK
Can we create Model class and DB context in blazor client and server side application? is this support?
Oct 30, 2019 01:51 PM|Mikesdotnetting|LINK
You don't want a DbContext in the client application. It will not be able to connect to a database. That's why your data access will be via Web API controllers.
classes with the client application.