There has been a big change to the Spectre.Cli project that I'm using in the CLI Lesson series. The project and package has moved into the Spectre.Console project. This combines the code for building command-line interface apps with the Spectre.Console capabilities to create rich, modern console UI with color, layout, and controls. While this is … Continue reading Spectre.Cli Moved to Spectre.Console
Month: December 2020
Lesson 5.9: Refactor Service Code and Create LocationTemplateService
With our implementation of ItemTemplateService and MonsterTemplateService, there is a lot of repetitive code. The act of getting data from the query string and calling the appropriate repository method is boilerplate that can happen in a lot of our services. This code is a great candidate for refactoring into a helper class that contains the … Continue reading Lesson 5.9: Refactor Service Code and Create LocationTemplateService
Lesson 1.2: Multiple, Default, and Hidden Commands
Having one command, like we did in our first lesson, is useful but limited. With Spectre.Console.Cli, we can define multiple commands, each with their own arguments and options, and each getting called when the user specifies that command in the command-line arguments. So let's take a look at defining multiple commands and a default command … Continue reading Lesson 1.2: Multiple, Default, and Hidden Commands
Lesson 5.8: Microservices Concepts With MonsterTemplateService
With our first service complete, it's time for us to look into creating more services. Each of our data files in the SimpleRPG game can really be thought of as its own service. Each one represents some classes and domain model like items or monsters. And while they may interact with one another (monsters can … Continue reading Lesson 5.8: Microservices Concepts With MonsterTemplateService
Azure Static Web Apps with Blazor WebAssembly
Azure has Static Web Apps functionality integrated with Blazor now, but only works with GitHub as the source repository for the preview version. This article has a great description of how to get it working. It appears that the Azure Static Web Apps functionality really streamlines the process for building CI/CD for these types of … Continue reading Azure Static Web Apps with Blazor WebAssembly
Lesson 1.1: Starting with Spectre.Console.Cli
I've been writing a lot of command-line apps to try out .NET Core and now .NET 5. There's always a lot of repeated code to setup the application, parse the command-line arguments, and then map those to operations performed by the program. I started researching some frameworks for building command-line interfaces (CLI) and there are … Continue reading Lesson 1.1: Starting with Spectre.Console.Cli
Lesson 5.7 Design REST Service for Data Retrieval
REST web services (Representational State Transfer) is a style of architecture based on a set of principles that describe how networked resources are defined and addressed. It is important to note that REST is a style of software architecture as opposed to a set of standards. As a result, applications or architectures are sometimes referred … Continue reading Lesson 5.7 Design REST Service for Data Retrieval
Lesson 5.6: Build Repository Pattern for Data Access
With our simple Azure Functions web service in place, we can now focus on providing more complex functionality from our service. We will focus on read-only service features for now, since we're reading game data and no persisting any data yet. We want to build a service that will return lists of elements based on … Continue reading Lesson 5.6: Build Repository Pattern for Data Access