Blog Posts with Tag .NET
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…
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…
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…
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…
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…
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…
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…
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…
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…