After a bit of experimentation, you might want to change the default member generation when you add an injected member to your C# constructor in Visual Studio 2019.
Here’s what you likely want to use as a private member in your class:
private readonly IHttpContextAccessor _httpContextAccessor;
Here’s what the constructor (ctor) looks like:
public BearerTokenHandler(IHttpContextAccessor httpContextAccessor)
_httpContextAccessor = httpContextAccessor ??
throw new ArgumentNullException(nameof(httpContextAccessor));
To get that automatically, you’ll need to change the option for it which is deep inside the Visual Studio options menu.
First, navigate to:
Click on the “Manage naming styles” button.
Fill it out like this:
Close that and then choose your new specification naming style for “Private or Internal Field”:
Click “OK” and it should immediately take effect next time you use the “Quick Refactorings” wizard to add a new member. Try it out!
Like a lot of people trying to stay sane during the pandemic, I’ve come up with a few diversions to keep myself occupied. I’ve been a fan like many others of Arnold’s movies, and I decided to watch them in release order. Last week I came up with the idea of ranking them as I watched them in order of how much I liked them compared to the others I had watched. I am going to skip all of the “Conan” movie roles he was in because I’ve seen them all way too many times. I’m going to start the list with “The Terminator” and end with the second “The Expendables” movie. That’s 21 movies! I’m not going to watch movies where he is just appearing as a cameo. Asterisk by the movie indicates I’ve never seen it before.
- The Terminator (1984)
- Predator (1987)
- Terminator 2: Judgment Day (1991)
- Total Recall (1990)
- Kindergarten Cop (1990) *
- The Running Man (1987)
- Commando (1985)
- Last Action Hero (1993) *
- Twins (1988) *
- Raw Deal (1986)
- Red Heat (1988)
- True Lies (1994)
- Junior (1994) *
- Eraser (1996) *
- Jingle All the Way (1996) *
- Batman & Robin (1997)
- End of Days (1999) *
- The 6th Day (2000) *
- Collateral Damage (2002) *
- Terminator 3: Rise of the Machines (2003)
- The Expendables 2 (2012) *
June 13 Update
Total Recall gets slotted at the #3 spot. It has just as much 80s cheese as The Running Man, but it has a much better storyline. The violence was IMHO a bit on the egregious side, but then again this was a Verhoeven movie.
June 22 Update
I’m surprised at myself for how I ranked Kindergarten Cop so high in the current list. It was a completely enjoyable comedy/action movie that had a solid plot, great acting by Arnold and others, and a believable villain. Terminator 2 did not disappoint. I think this was only the 3rd time I’ve watched this movie and that was a long time ago. The special effects were still great compared to today – but my main complaint was that the T-1000 terminator was way too powerful. They should have degraded his capabilities as the injuries mounted, ESPECIALLY after he was completely frozen by liquid nitrogen. Ok, onward to Last Action Hero which I’ve never seen and I’m excited to watch it.
June 24 Update
I was disappointed with Last Action Hero. It started very, very, very slow. Then it had a few interesting parts and then – credits. Best part about the movie was the soundtrack.
The late, great .Net guru K Scott Allen created and supported a middleware bridge for .Net Core projects that provide support for using NPM modules (“package.json”) in .Net projects. This NuGet library will install the support for you.
What it will get you is the ability to reference external libraries such as jQuery and bootstrap within a web project in .Net Core.
Usage is quite simple. Simply pull the package down via NuGet, install your npm packages and then add this simple line in startup.cs:
That’s it. Then in your source html and razor pages you can reference the /node_modules directory as if it was a child of the wwwroot folder which is where .Net core normally looks for static files.
I’m cleaning up a Swift project and wanted a time saving tool to show me all of the unused variables and funcs. This smarty, Paul Taykalo, created a Ruby script that works like a charm.
Here’s his Medium article on the subject.
Here’s the GitHub repo to download.
Here’s some sample output from the project I’m working on: