Posts

Showing posts with the label CRUD

Why Repository Abstractions Usually Hurt Blazor Apps More Than Help “You didn’t decouple EF Core. You just hid it badly.”

Image
 “You didn’t decouple EF Core. You just hid it badly.” I’ve built this architecture. More than once. Early in my Blazor projects, adding repository abstractions felt like the responsible thing to do. The code looked clean. The layers were clear. Code reviews were easy. Then the app grew. The team changed. Performance started to matter. That’s when the repository layer stopped helping—and started getting in the way. This article isn’t about theory. It’s about what I’ve learned the hard way, maintaining long-lived Blazor applications. Why I Used Repositories (And Why They Felt Right) I didn’t introduce repositories because I was careless. I did it because: Books recommended them Talks showcased them Juniors expected them “Clean Architecture” diagrams normalized them And early on? They worked. That’s the trap. The Year-Two Problem The pain never shows up in month three. It shows up when: Queries need tunin...

Blazor Bug Tracker With Scafolding

Image
  In Visual Studio, there is a feature under Add – New – Item called "Add Scaffolding Item". After viewing a couple of  YouTube videos on how to use it, it got me thinking, is this a realistic feature, or is it just a nice demoable feature?   It does demo nicely. I decided to try it and see for myself how much value this feature can add for me when creating new applications that need CRUD actions. The Test Application To validate the scaffolding, I will be building a basic defect-tracking application using the scaffolding feature.   We will have only three issue types and will be using Entity Framework with an SQLite database.  I will be focusing on the scaffolding, not the features of the application. Granted it will be a scaled-down system, but there is CRUD used.  These are the issue types I will be creating:                1.       Bug – issue report from the internal team ...

Blazor Weather Forecast CRUD

Image
  On my way to set up SQLite within Blazor, I ran into a few more hurdles than I was expecting. So, I decided to write about it. I have used SQLite with C# in the past and it was quite straightforward. But since then, there must have been a couple of updates that did not work quite like they expected. Once I got SQLite working, I decided it would be fun to create a new Weather Forecast CRUD application to highlight using SQLite with Blazor. That part turned out to be fun. Application Goal The goal was simple, using the Weather Forecast, Fetch data, part of the standard Blazor template, read the records from an SQLite database, and add the functionality of adding, editing, and deleting forecast records. Additionally, I wanted to use TailwindCss for styling. I am incredibly pleased with the result of the application. Connecting to SQLite Connection to SQLite has simple steps:      1. Add NuGet Microsoft.EntityFramework.Core.SQLite      2. Add NuGe...