At one of my clients, I was showing him how to structure a complex Linq query. This came as a surprise to him and I thought it was worth a quick blog entry.
I've been posting and making videos about ideas I've had for discovering Minimal APIs instead of mapping them all in `Program.cs` for a while. I've finally codified it into an experimental nuget package. Let's talk about how it works.
As you likely know if you've read my blog before, I have spent the last decade or so creating courses to be viewed on Pluralsight. I love making these kinds of video-based courses, but I've decided to get back to instructor led training a bit.
This topic has been on my TODO: list for quite a while now. As I work with clients, many of them are just ignoring the warnings that you get from Nullable Reference Types. When Microsoft changed to make nullability the default, some developers seemed to be confused by the need.
Most of my job these days is creating tutorials or examples. This means I often start from scratch with a new type of project. I usually just cruft up some sample data for my project to start. While investigating some alternatives to Automapper (video and blog coming soon), I wanted to be able to create a bunch of sample data. I, luckily, ran into a tool that I was surprised I'd never heard of: Bogus.
If you've heard me talk about Vite in the past (and so commonly mispronouce it), you know I am a fan. With many Vue, React and SvelteKit applications are moving to Vite, I've been investigating how to integrate it for development and production into ASP.NET Core applications. Let's see what I found out.
I recently released a Coding Short video and a blog post about the new JWT Tooling in .NET 7. It was received well, but I didn't dig into some of the real details of what is happening.
If you've taken my "Building an API with ASP.NET Core" course over at Pluralsight, one of the more complicated tasks is to add support for JWT Tokens. In .NET 7, they've simplified this quite a bit.
With the release of C# 11, there is a new string in town. It might be getting crazy, but this new "Raw String Literals" is something interesting.
I can't believe October is almost over! I forgot to post about a couple of videos I made this month.
I've been busy with a lot of small projects lately. Among these is to get up to speed with .NET 7 and C# 11. One of the things I've been curious about is the new support for Generic Attributes.
In continuing my discussion of middleware in my Coding Shorts videos, I have a new one that talks about a change to .NET 7 that brings back Output Caching.
After my recent video about How ASP.NET Core Middleware Works, I'm continuing to plow through some important pieces of middlware you might not be using.
I just got back from four conferences in Europe...and boy are my arms tired. One of the common themes of a lot of talks seemed to be the magic of microservices. I decided to give my 2 cents on the subject in this new rant:
I have a small link shortener that I run for myself. I built it mostly so I could update short links when an URL changes (which bitly didn't let me do). It's been running for a few months and I'm really happy with it. One of the things that I missed was tracking the usage of short links to see how they were being used.
My recent video elicited several interesting responses. But immediately, I noticed that using ASP.NET Core's cache busting (e.g. asp-append-version) wasn't working quite right for additional StaticFiles middleware. Evidently, I wasn't doing it correctly. Let's walk you through it.
After discussing this topic with a client, I realized that my old method of hosting SPAs in ASP.NET Core didn't handle resources correctly, so I dug in and came up with **yet another** technique. This one is the simpliest and the least intrusive and works better than most. Let me know what you think about it:
I love that this job allows me to learn new stuff every day. In this case, I was building a simple API to use for some upcoming <a href="https://shawnl.ink/psauthor">Pluralsight</a> courses. I wanted to use Minimal APIs to expose some data for an old dataset from <a href="https://data.fivethirtyeight.com">FiveThirtyEight</a> on Bechdel Tests for Films. While I was adding paging, I got confused.
I've started staying on top of early releases on .NET 7 and C# 11 already. In this new Coding Shorts video, I look at four of the released changes to C# and hopefully you can get a head start on seeing where C# is going.
.NET 6 Preview 6 is here. One of the big changes I'm looking forward to is how startup is changing. With this change, comes "Minimal APIs" too. While getting rid of the Startup class is a welcome change, I'm a little less excited about how Minimal APIs might be over-used.
Like most of you, I've been using Dependency Injection in my projects for quite a while. Whether it be the built-in .NET Core Dependency Injection layer, Ninject, StructureMap, Unity, MEF, etc. I've been using a DI layer to do this work for many years. But before I understood the benefit, I did so somewhat reluctantly.
I have a couple of public projects (this blog, and the code camp website) that both use Azure Blob storage to store images for the sites. I've felt guilty that I've copy/pasted the code between them for a while. I decided to fix it.
It was a Sunday afternoon and I wanted to play with some of the new features of .NET 5 and learn something. I had a small irritation with bit.ly. When I customized a short-URL, I could never go back and update the link. That was enough for me to want to make something.
I hope you're watching the .NET Conf happening this week. If you have, you know that .NET 5 was finally released. This version isn't a long-term support (LTS) version, but that doesn't mean that many people will be using it in production...at least I will be.
[UPDATE] After reviewing some of the code and talking with commenters, I agree that using HostServices for console apps is a bad idea. I've refactored this to use the host but not the HostService. I believe that the entire host is still useful for configuration, logging, and DI. See below for the latest changes:
I'm finally getting around to looking at updating my examples and courses to 3.0. This post is based on .NET Core Preview 8 so this might change in the future.
I am getting married and that means I get a bunch of development tasks to do for the wedding planning. I guess it’s my own fault, I did propose with an app.
As some of you know, I authored a Pluralsight course on JavaScript for C# Developers. We’ve released an excerpt from that course covering how JavaScript function scopes work.
This is another in my series about (hopefully) interesting JavaScript constructs that might surprise most C# developers. You can see others here: JavaScript for the C# Guy.
Url: http://wilderminds.blob.core.windows.net/downloads/asynchronousclo...
Url: http://code.msdn.microsoft.com/sourceanalysis/R...
Url: http://www.panopticoncentral.net/archive/2005/0...
Url: http://msdn.microsoft.com/library/default.asp?u...
Url: http://lab.msdn.microsoft.com/productfeedback/v...
I found it very interesting in a little test that the Flags attribute doesn't seem to change the way that the CLR numbers Enumerations. So that this enumeration:
Url: http://www.windojitsu.com/blog/nestedclasses101...
Url: http://www.dotnetconsult.co.uk/weblog/permalink...
I got to play with an Itanium 2 Box at the PDC today. Instead of following their script, I did what I've wanted to do for months...creating a huge DataSet. They had an interesting setup. You used a Pentium 4 box to develop code and then Terminal Service'd into a sixteen-way Itanium 2 machine to run the code. The 64 bit JIT's the IL to 64 bit code from the same assembly that the 32 bit JIT did to create the 32 bit code.
Everytime I add a app.config file to a new C# App, it never does what I want. I want the app.config file to be deployed to the build directory so I can make changes to the app.config file and have it propogated. With the release of VS.NET 2003, us C# developers now have pre and post build steps. So I now have to remember to add the following to the post-build event: