Blog Posts with Tag .NET

New Periodic Timer API in .NET 6

The GA of .NET 6 is right around the corner, I've posted some articles in the past about upcoming changes I'm looking forward to. While there are a lot of major improvements that get a lot of attention, many of the smaller improvements get pushed to the wayside. One small change that I really like is the new PeriodicTimer class. Previously Timers in .NET revolved around a callback interface. System.Timers.Timer had a event which an event handler could be added that would be…

October 27, 2021
|
approximately 2 minutes to read
Building APIs: Generating API Clients with OpenAPI Generator

APIs are everywhere! APIs are one of the basic building blocks of modern software architectures. With the proliferation of HTTP based APIs, facilitating API consumption with minimal effort becomes crucial. The bridge between programming languages and APIs is to use a programmatic API specification that defines the contracts of the API. From there, utilizing tools to read that specification to generate an API client. When utilizing a single language, it's sometimes possible to…

August 30, 2021
|
approximately 5 minutes to read
Minimal APIs in .NET Core 6

One thing I've been jealous of scripting languages over the years is how easily they can be used to build out small and simple applications. For example, Node.js has the express library whereby a complete API can be built out in a single file. While more complex projects necessitate more framework than that, the required scaffolding for a simple program is fairly low. In languages such as C#, prior to .NET 6, to build out a simple API requires some degree of pomp and…

June 11, 2021
|
approximately 3 minutes to read
New Namespace Features in C# 10

With .NET 6 arriving this fall, there are a wealth of new features being introduced that I'm really excited about. With most new .NET versions come new features added to the C# language. As part of this article, I'm going to pick out a few of my favorites being introduced in C# 10 related to namespaces that I'll use often. Keep in mind, .NET 6 is still in preview, so it's always possible they could get cut or changed in the final release. However, I've seen them demoed by…

June 06, 2021
|
approximately 2 minutes to read
Raspberry Pi Camera: 3D Printing a Pan / Tilt Arm

In a previous post I introduced my project to take pictures with my Raspberry Pi. So far, this is a two part project. Build an image microservice I can use to snap pictures of the outside world. Build a machine learning microservice which has the capabilities to recognize objects in those pictures. For the next part of my project, I wanted to mount my camera on my Raspberry Pi. Rather than having it be in a fixed positon, I wanted it to move. So, I decided to build a pan/tilt…

April 17, 2021
|
approximately 5 minutes to read
Design Patterns: Dependency Injection

One of my favorite features of .NET Core / .NET 5+ is it's dependency injection (DI) framework. If you've been stuck in .NET Framework, or old ASP.Net, it is one of the biggest fundamental changes with how applications are pieced together. I had started using a now abandoned IoC container, Ninject close to ten years ago. It radically changed the way I approached writing software. I was very happy to see .NET Core embrace this DI pattern. What is Dependency Injection In short…

April 10, 2021
|
approximately 5 minutes to read
Object Detection with ML.Net

I've always found machine learning interesting, but never taken the time to implement something. The best way to do that? Involve my Raspberry Pi of course. I created an application to detect objects in images captured by my Raspberry Pi. The application is an ASP.Net Core WebApi which hosts two services. The first draws boxes around objects in the image returning the modified image. The second returns a JSON representation of the objects that were found. Here's a picture of…

April 05, 2021
|
approximately 3 minutes to read
Reading COVID-19 Statistics in .NET

As part of my new COVID-19 application I've been writing, I had to import statistics from a data source. The COVID Tracking Project maintains daily records of various statistics regarding the pandemic for each state and at a nation level. It publishes this data as an API and also as a set of CSV files. While the API worked, it did not provide the type of extensibility I wanted in order to serve up the data. As such, I decided to read the raw data from a CSV file to import…

February 12, 2021
|
approximately 3 minutes to read
Running Startup Logic in ASP.Net Core Applications

In web applications, it can be necessary to have tasks that run on start up of an application. In older ASP.Net, this was not as clear cut how to accomplish. In ASP.Net Core there is a clear pattern established through the IHostedService interface to make this a breeze. As part of my COVID-19 application, I had to create a few of these hosted services. For example, I had to set up my database prior to the application actually running. As this application is utilizing an in…

February 06, 2021
|
approximately 2 minutes to read
© 2024 - Built and designed by Jeremy Honl with Gatsby. Images are from Unsplash