Posts

Showing posts from January, 2023

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 NuGet Microsoft.EntityFramework.Core.T

Simple Authentication Sample

Image
  I came across a couple of use cases where I needed remarkably simple authentication for a couple of applications. The applications would have less than 5 users. This made the prospect of standing up a new database or even using an existing one for auth using an Identity server seem like way overkill. I do want to utilize the built-in Authorization View components that Blazor has. Use Case:           Quick Access to a project for a client that is not ready to be public           As an admin for a project to manage system configurations This post describes my solution. A simple authentication system. The base requirements for the authentication solution are :           Five or less users           No user maintenance will be required           The user may be hard coded, provided by an encrypted file, or even as app setting values           Avoid the extra cost or overhead of using a database           Authentication is valid for a single session           Once the users cl