Tag: 'c#'

Composing Linq Queries
Composing Linq Queries
July 20, 2024

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.

A Minimal API Discovery Tool for Large APIs
A Minimal API Discovery Tool for Large APIs
February 22, 2023

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.

I'm Hosting Two New Online Courses
I'm Hosting Two New Online Courses
February 17, 2023

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.

Digging Into Nullable Reference Types in C#
Digging Into Nullable Reference Types in C#
February 13, 2023

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.

Generating Sample Data with Bogus
Generating Sample Data with Bogus
January 29, 2023

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.

Vite-Powered SPAs in ASP.NET Core Projects
Vite-Powered SPAs in ASP.NET Core Projects
January 18, 2023

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.

More on .NET 7 user-jwts Tool
More on .NET 7 user-jwts Tool
January 10, 2023

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.

Changes in JWT Bearer Token Setup in .NET 7
Changes in JWT Bearer Token Setup in .NET 7
December 7, 2022

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.

Wiring Up Azure AD to ASP.NET 7
Wiring Up Azure AD to ASP.NET 7
December 7, 2022

C# 11 Strings in the Raw
C# 11 Strings in the Raw
November 26, 2022

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.

New Videos: Coding Short and a Rant
New Videos: Coding Short and a Rant
October 31, 2022

I can't believe October is almost over! I forgot to post about a couple of videos I made this month.

New Video: Coding Shorts - Generic Attributes in C# 11
New Video: Coding Shorts - Generic Attributes in C# 11
September 15, 2022

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.

New Video: Coding Shorts - Output Caching in ASP.NET Core 7
New Video: Coding Shorts - Output Caching in ASP.NET Core 7
August 10, 2022

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.

New Video: Coding Shorts - Response Caching in ASP.NET Core
New Video: Coding Shorts - Response Caching in ASP.NET Core
July 27, 2022

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.

New Rant: On Microservice Architecture
New Rant: On Microservice Architecture
June 7, 2022

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:

Using Background Services in ASP.NET Core
Using Background Services in ASP.NET Core
May 4, 2022

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.

Multiple Directories for Static Files in ASP.NET Core
Multiple Directories for Static Files in ASP.NET Core
April 25, 2022

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.

SPAs in ASP.NET Core - Another Attempt
SPAs in ASP.NET Core - Another Attempt
April 20, 2022

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:

How to Access Query Strings in Minimal APIs
How to Access Query Strings in Minimal APIs
April 4, 2022

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.

New Video: An Early Look at C# 11
New Video: An Early Look at C# 11
March 20, 2022

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.

Coding Shorts: Changes to Coming to Startup in .NET 6
Coding Shorts: Changes to Coming to Startup in .NET 6
August 4, 2021

.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.

Coding Shorts: Dependency Injection Explained
Coding Shorts: Dependency Injection Explained
July 5, 2021

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.

Should You Always Create a Nuget Package? Asking for a Friend...
Should You Always Create a Nuget Package? Asking for a Friend...
November 29, 2020

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.

Lazy Sunday with .NET 5
Lazy Sunday with .NET 5
November 16, 2020

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.

Updating My Projects to .NET 5
Updating My Projects to .NET 5
November 12, 2020

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.

.NET Core Console Apps  - A Better Way?
.NET Core Console Apps - A Better Way?
August 2, 2020

[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:

My First Look at ASP.NET Core 3.0
My First Look at ASP.NET Core 3.0
August 19, 2019

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.

My First ScriptCS
My First ScriptCS
January 10, 2017

Time Zones and Servers
Time Zones and Servers
May 8, 2014

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.

JavaScript Function Scopes
JavaScript Function Scopes
October 16, 2013

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.

JavaScript for the C# Guy: The confusion about 'this'
JavaScript for the C# Guy: The confusion about 'this'
May 28, 2012

JavaScript for the C# Guy: The Global Object
JavaScript for the C# Guy: The Global Object
May 6, 2012

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.

JavaScript for the C# Guy: Scopes
JavaScript for the C# Guy: Scopes
March 16, 2012

Using Closures to Simplify Asynchronous Programming
Using Closures to Simplify Asynchronous Programming
December 26, 2008

Url: http://wilderminds.blob.core.windows.net/downloads/asynchronousclo...

Microsoft Announces Source Code Analysis for C#
Microsoft Announces Source Code Analysis for C#
May 23, 2008

Url: http://code.msdn.microsoft.com/sourceanalysis/R...

Speaking at the Atlanta Code Camp
Speaking at the Atlanta Code Camp
March 26, 2008

Url: http://www.atlantacodecamp.com

The C# Team seems to speak out of both sides of its mouth
The C# Team seems to speak out of both sides of its mouth
March 18, 2007

Url: http://www.panopticoncentral.net/archive/2005/0...

Fun with C# Switches
Fun with C# Switches
February 6, 2006

Url: http://msdn.microsoft.com/library/default.asp?u...

Visual Studio Beta 3?
Visual Studio Beta 3?
August 25, 2005

Url: http://lab.msdn.microsoft.com/productfeedback/v...

Of Enum, FlagsAttribute and Enum.Parse
Of Enum, FlagsAttribute and Enum.Parse
August 5, 2005

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.&nbsp; So that this enumeration:

101 Uses for Nested Classes
101 Uses for Nested Classes
March 25, 2005

Url: http://www.windojitsu.com/blog/nestedclasses101...

Virtual   New is Evil?  I am convinced...
Virtual New is Evil? I am convinced...
November 23, 2004

Url: http://www.dotnetconsult.co.uk/weblog/permalink...

Getting My Hands on the 64 bit Framework
Getting My Hands on the 64 bit Framework
October 29, 2003

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.

App.config and C# Projects (Updated)
App.config and C# Projects (Updated)
August 23, 2003

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: