https://github.com/erossini/blazorapiefcore
Example of using Entity Framework Core via APIs with complex objects
https://github.com/erossini/blazorapiefcore
blazor csharp entity-framework-core minimal-api
Last synced: 3 months ago
JSON representation
Example of using Entity Framework Core via APIs with complex objects
- Host: GitHub
- URL: https://github.com/erossini/blazorapiefcore
- Owner: erossini
- Created: 2025-02-18T22:43:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-23T21:51:15.000Z (over 1 year ago)
- Last Synced: 2025-03-01T23:07:28.195Z (over 1 year ago)
- Topics: blazor, csharp, entity-framework-core, minimal-api
- Language: HTML
- Homepage: https://puresourcecode.com/dotnet/net9/apis-with-entity-framework-core/
- Size: 782 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
Awesome Lists containing this project
README
# Using Entity Framework Core via APIs with complex objects
I want to give a complete example of minimal APIs in Blazor with Entity Framework Core with complex objects. I always struggle to have a solution working when my model has dependencies with other object. Here I show my test and my code. The code is in [NET9](https://puresourcecode.com/category/dotnet/net9/). In the [Microsoft documentation](https://learn.microsoft.com/en-us/aspnet/core/data/ef-mvc/update-related-data?view=aspnetcore-9.0), there are some examples but it is not complex enough. A few days ago, [I posted about another problem](https://puresourcecode.com/dotnet/net9/pendingmodelchangeswarning-with-net9/) I had with NET9 and Entity Framework Core.
## Posts
This code is related to the following posts:
- [APIs with Entity Framework Core](https://puresourcecode.com/dotnet/net9/apis-with-entity-framework-core)
- [APIs with Entity Framework Core: POST](https://puresourcecode.com/dotnet/csharp/apis-with-entity-framework-core-post/)
- [APIs with Entity Framework Core: PUT](https://puresourcecode.com/dotnet/net7/apis-with-entity-framework-core-put/)
## Why this project
Let me show a real database I'm working on. As you can see I have a few tables but not all of them are coming strictly from the code. The tables `Clients`, `ClientAddresses` and `tbl_Channels` are created from the `Domain`. `ChannelClient` is a joined table that Entity Framework Core is creating automatically.
