Why do I want to Email Myself Every Day? After creating an Apps Script to email myself every day from a Google Sheet, someone asked: Why? Overall I find I can face the day better when I have timed reminders inside my inbox. My deep work is deeper, and almost nothing gets forgotten, when I want ...
More Design Patterns For Machine Learning Systems 9 patterns including HITL, hard mining, reframing, cascade, data flywheel, business rules layer, and more.
ChatGPT-4 outperformed 90% developers Discover how ChatGPT-4 surpasses 90% of developers in solving coding challenges. Explore the future and potential of AI in software development.
Drop down lists in ASP.NET MVC | no dogma blog Full source code is a attached here. This post shows two methods of implementing drop down lists in ASP.NET MVC 4. The code for data access and the general layout of the application should not be considered suitable for anything other than pedagogical pur...
Debugging an AWS Lambda Function Locally with Visual Studio Code (VS Code) on Windows, Linux, and Mac | no dogma blog It is easy to debug an AWS Lambda function locally with Visual Studio Code, all you need to do is install one tool and make one change to the launch.json file. Read on to see how.
Simmy Chaos Engine for .NET – Part 5, Breaking Your Own Code | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. The blog posts I have written so far about Simmy all deal with the scenario where you don’t have control over the source code that you want to break, in these ca...
Text to Speech with Amazon Polly and .NET | no dogma blog Using Amazon Polly to convert text to speech is very easy, with a small .NET console application you can send the text to Amazon and play it on your computer.
Reading CSV Files into Objects with Node.js | no dogma blog Full source code available here. As I am learning Node.Js I am constantly surprised by how easy it is to do some things, and how difficult to do others, and how poor the examples out there are.
The Circuit Breaker pattern with Polly | no dogma blog Full source code available here. Want to learn more about Polly? Check out my Pluralsight course on it. This post on the Polly circuit breaker is part of a larger series of post on the Polly Resilience Framework, see here for the others, or check out my P...
GitHub Actions with .NET, Part 2 - Dependent Jobs | no dogma blog In the previous post I gave a quick introduction to GitHub Actions showing how to build a small Hello World application and make the artifact available for download. In this post, I'll show how to build debug and release versions of the same application, ...
Varying the Time Between Polly Retries Based on the Exception | no dogma blog Polly's Wait and Retry lets you decide how long it should pause based on the exception thrown in the invoked code. This is very useful when you know what problems can occur and how long you need to wait for them to resolve.
Working with JSON in .NET, Infrastructure as Code with Pulumi | no dogma blog Full source code available here. This is a follow up to my previous post where I used dynamic and JSON files to make querying ElasticSearch with a HttpClient much easier.
Installing Rider on Linux with .NET 7 | no dogma blog While trying to use Rider on Linux, I hit these errors "load failed", "MSBuild is required to load project 'HelloLinux' but it was not found", and "MSBuild (Microsoft Build Engine) is required to load and build project 'HelloLinux'". If you got any of the...
Customizing a specific string inside a class using AutoFixture | no dogma blog Full source code. I’ve been using AutoFixture for a while with my unit tests. It creates objects with prefilled data, saving me the hassle of manually constructing them. Basic usage If you want a string from AutoFixture do something like -
Caching Values Inside HttpResponseMessage with Polly – caching series 2/3 | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. In this, the second of three posts on caching in Polly, I will show how to cache the values returned inside a HttpResponseMessage as opposed to caching the respo...
Netlify, Hugo, and Wowchemy or: How I Learned to Stop Worrying and Love the Blog | no dogma blog For years my blog was on WordPress hosted by a third party, I recently moved it to Netlify, Hugo, and Wowchemy. It is much faster, easier to work with, more reliable, and more secure. Getting a blog up and running with those tools is very easy; migrating ...
Caching in Polly and the HttpClientFactory | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. Polly allows you to cache a response for reuse by a subsequent request, it supports both local an distributed caches, full information can be found here https://...
A Simple Example of Amazon Transcribe with .NET | no dogma blog Speech to text is now as simple as uploading a file, starting a transcription job, and waiting for the results.
Entity Framework Core, Calling Stored Procedures and Returning to a Model | no dogma blog Full source code available here. I wrote a post some time back about calling a stored procedure with Entity Framework using the DbCommand, but it was a bit complicated and not that easy to use.
Fluent Validation in ASP.NET Core | no dogma blog Full source code available here. I have written about Fluent Validation a couple of times. There is a new library available for .Net Core. How to return to validation messages back to the caller is not immediately obvious.
Testing Your Code When Using Polly | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. When developing an application with Polly you will also probably want to write some unit tests.
Signing calls to Lambda Function URLs using IAM auth with HttpClient | no dogma blog If you are using IAM auth with Lambda Function URLs, and you want to call the function using HttpClient from a .NET application, you need to sign the request. Read on to see how.
C# and AWS Lambdas, Part 2 - Web API and an API Gateway | no dogma blog In the [previous post](/2021/02/c-and-aws-lambdas-part-1-hello-world/) I created a Lambda that executed a C# console application. In this post, I walk through creating a .NET Core 3.1 Web API application inside a Lambda and making it reachable from the we...
Using the In-Memory Cache with .NET Core Web API | no dogma blog Full source code available here. If you need to store anything temporarily within an application, you should consider using the In-Memory Cache from Microsoft. In .NET Core it is much easier to use than its predecessor from Framework 4.
Caching Secrets Manager Secrets with a Lambda Layer | no dogma blog Lambda layers allow you to leverage functionality provided by AWS. This post shows how to use the AWS Parameters and Secrets Lambda Extension to cache Secrets Manager secrets.
Doing a bit of Docker Cleanup | no dogma blog After using Docker for a while I like cleaning out all my images, containers, volumes, and the build cache. Here are some simple commands to do that.
The Simplest Hello World in Node.js | no dogma blog Full source code available here. I am learning Node.js and have found it a bit of a struggle to locate good, simple documentation. It feels like most people writing in the space assume a lot of existing knowledge, like you know how plenty of JavaScript, o...
Cached nuget packages causing you problems? | no dogma blog Short version If you are having problems with nuget packages and think it might be related to local caching delete packages from these directories - %LocalAppData%\NuGet\Cache and %userprofile%\.nuget\packages\ Long version I was making nuget package, let...
Fleet Manager, an easy way to check in on an EC2 Windows instance | no dogma blog Sometimes all you want to do is have a quick look at a Windows EC2 instance to see what is going on, or make a small change. I'll show how to do that without the difficulty of making security group changes.
Indexing the Works of Shakespeare in Elasticsearch - Part 1, Infrastructure as Code | no dogma blog Part one of a four-parter where I'm going to show how to index the complete works of Shakespeare in Elasticsearch. This first part will set up the infrastructure on AWS. The second will go through the lambda that bulk loads data into Elasticsearch. The th...
Pizza Delivery IoT Project Pt. 2 Continuing from Pizza Delivery IoT Project Pt. 1, I have completed much of the circuit design on my breadboard and completed the basic code necessary to interact with the sensors on the board. To interact with the various components on the board, I ...
Dotclear blog editing problem | no dogma blog The dotclear blogging engine has some issues when including pre-formated html; it removes all leading spaces and mangles empty lines. This is a significant problem when posting nicely coloured code snippets like those produced by hilite.
Accidental LLM Backdoor - Prompt Tricks In this video we explore various prompt tricks to manipulate the AI to respond in ways we want, even when the system instructions want something else. This c...
Improving Lambda Custom Runtime Cold Start and Deployment Speeds with .NET 6 | no dogma blog A couple of new features in .NET 6 improve Lambda cold start times and the speed of deploying new functions. Read on to see how.
WhenAny with a List of Different Types of Task, Processing Each as They Finish | no dogma blog After some discussions on Twitter a few new ways of using WhenAny with Tasks of different types came up. Here is what I think will be my last post on this topic for a while, probably...
GitHub Actions with .NET, Part 3 - Manual Approvals | no dogma blog Sometimes you will want a user to approve a build job/step in GitHub Actions, in this post I show you how to do just that.
Executing an AWS .NET Lambda at an Exact Time with Step Functions | no dogma blog AWS Step Functions are a very easy way to orchestrate many things. But they can also be used to run a Lambda at an exact time (down to a tenth of a second, or less), up to a year in the future.
Web API 2 and ninject, how to make them work together | no dogma blog Full source code to download. I’ve been using ninject for a few years, but every time I use it with Web Api I hit some problem and they usually stem from not including the right nuget packages, not changing the DependencyResolver or (once) forgetting how ...
Indexing the Works of Shakespeare in Elasticsearch – Part 3, Sending the Lines to Kinesis | no dogma blog In this, the third part of the series, I show how to read from the Shakespeare CSV file where each row represents a line from a play, ([download here](https://file.ac/5b5t4n9lN5o/Shakespeare%20Plays.csv)), and send these lines to Kinesis. The lambda in AW...
Accessing AWS Secrets Manager from .NET Lambda Functions, Part 2 - Using Async Code | no dogma blog In an earlier post I showed how to use a .NET 6 Lambda function to retrieve a secret from Secrets Manager synchronously, but it is also easy to do this asynchronously.
Downloading an in-memory file using Web Api 2 | no dogma blog Download full source code At first you think it’s going to be easy to download a file from Web Api, but as I discovered, it was not. In my case I wanted to load data from the database, perform some processing and return a subset of the data as a file.
Running an AWS Lambda Command from Windows Shells | no dogma blog Calling an AWS Lambda from Windows 10 is different depending on the shell you are using. In this post, I'll show how to call a simple Lambda that takes a simple event document from PowerShell, the command prompt, the WSL Ubuntu shell, and the git bash she...
Logging to DataDog with Serliog and .Net 5 | no dogma blog Quick example of using DataDag with a .Net 5 Web Api application on your local computer.
HttpContent ReadAsAsync with .NET Core 2 | no dogma blog Full source code available here. If you are used to using HttpContent.ReadAsAsync you might be surprised to learn that it is missing from .NET Core 2. You can try adding Microsoft.
Loading Config from Multiple Sources with .NET Core 2.x Web Api or MVC | no dogma blog Full source code available here. .NET Core 2 and .NET Core 2.1 offer many ways to load configuration and they are well documented by Microsoft. But there is one scenario that I didn’t see explained.
VS Code Bug - Interpolation and Commented Lines, Workaround | no dogma blog There is a bug in VS Code that occurs when you use string with `@$` - the verbatim character and the interpolation characters, but there is a workaround.
Parameterized SQL WHERE IN clause C# | no dogma blog If you are using some legacy SQL in C# you’ll occasionally need to write a WHERE IN. You don’t want to end up writing something like the below, either directly or through some sort of loop.
Polly with .NET 6, Part 2 - Dependency Injection of a HttpClientFactory with a Retry Policy | no dogma blog This post shows how to use Polly with .NET 6; injecting a HttpClientFactory with a Retry policy into a controller.
Entity Framework in an Dynamics Nav (Navision) environment (or using EF to access tables with unknown table names) | no dogma blog Summary In this post I show how to use dynamic compilation to allow Entity Framework to reference tables whose names are not known at compile time. Details Entity Framework works great for the majority of scenarios; it handles tables in one database or sp...
Entity Framework lazy loading vs explicit loading and the generated SQL | no dogma blog Download the source code here. If you are using lazy loading with Entity Framework you should check that queries to the database are working as expected. A lazy load call to something like customer.
Calling one Lambda Function from another with the Lambda .NET SDK | no dogma blog Calling one Lambda function from another is something you'll occasionally need to do. If you are using Lambda function URLs it is a simple HTTP request. But you can also use the AWS Lambda SDK to invoke the other function.
Creating an ASCII Table with C# | no dogma blog I was re-watching The Martian a few weeks ago. There is a scene Mark Watney needs an ASCII table, he rummages through the laptop of one of the crew to find one. This got me thinking that it should be very easy to create a table with a simple program.
Simmy Chaos Engine for .NET – Part 3, Adding Latency | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. This is the third in my series on chaos engineering with Simmy. The first two posts dealt with the fault policy throwing exceptions and returning failed response...
Getting .NET Core 2.1 Preview 2 Working with Visual Studio 2017 | no dogma blog About a year ago I wanted to start using .NET Framework 4.7, it should have been an easy process, but wasn’t. After some trial and error if figured it out and wrote a blog post explaining how to get it working.
Saving enums as strings with Entity Framework | no dogma blog In September 2018 I wrote a new post explaining how to store enums as ints or strings with Entity Framework Core. It is a nicer solution than the one presented here.
Performing a WHERE IN with Entity Framework or on a List | no dogma blog WHERE IN is a very useful and commonly used feature of SQL, it looks like this - SELECT * FROM ORDER WHERE OrderId IN (10248, 10249, 10250, 10251) The will return up to four rows of data, showing just the orders that have an OrderId in the list you passed...
Polly and Blazor, Part 2 – Using the Context | no dogma blog When using Blazor and Polly there are a few ways to pass data from Polly back to the UI, this example shows how to do this with the Polly Context.
Forcing the Lambda Service to Warm 100 Execution Environments for your Function | no dogma blog If you know that your Lambda function needs to handle bursts of activity at a predictable time, and you want to avoid the slower response of cold stars for that burst, you can force the Lambda service to warm up execution environments for you ahead of the...
C# and AWS Lambdas, Part 3 – Pulumi IaC for Web API and an API Gateway | no dogma blog In this the third in a series of posts on using .NET in AWS Lambdas I build on the previous post where I connected a Http Gateway to a Lambda running a Web API application. In that post I built the infrastructure by hand, i.e. via the GUI, pointing and cl...
Using Dependency Injection with Startup.cs in ASP.NET Core | no dogma blog Full source code available here. Did you know that .NET Core 2 can pass in an instance of any type you want to the Startup.cs constructor? Well you can! Here’s how.
How to Turn Off Console Logging for Kestrel in .NET Core | no dogma blog This post is mostly a note to myself. I am often annoyed with the amount of logging to the console that occurs when I start a Kestrel hosted application and I can never remember how to turn it off.
Entity Framework Core 2 Unit Testing in .NET Core 2 | no dogma blog Full source code available here. Unit testing Entity Framework used to be quite a chore, but over the past few years it has become significantly easier. In this post I’m going to show you how to use the InMemory database with named instances.
Varying the Time Between Polly Retries Based on the Result | no dogma blog This is a follow-up to a post I wrote a few days ago about varying the delay between retries based on the exception. This time I'm going to show how to vary the delay based on the result.
Requesting Data from two Data Stores in Sequence - Cache and a Database | no dogma blog There are times when firing off the same query in parallel to two or more data stores is a good choice, but normally hitting one, waiting for the response, and only hitting the second if necessary is a better approach. Here I'll show how to query Redis, a...
Dynamically Updating the Request Header of a HttpClientFactory Generated HttpClient, Part 1 | no dogma blog Full source code here. There are some subtle issues in the way I use DI in this post, see here for an alternative if you don’t want to follow this approach
.NET Minimal API part 8 - Structuring a minimal API project This video is somewhat long as it covers the following topics:0:00 Introduction0:20 Horizontal Layers & Vertical Slices4:20 Reasoning behind using a DbContex...
Programmatically Determine what Ports Kestrel is Running On | no dogma blog In the unlikely event you need to determine what port Kestrel is running on...
Using the Secrets Manager Cache with .NET | no dogma blog Secrets are usually retrieved far more often than they are changed. The AWS Secrets Manager cache lets you cache secrets for a specified period, reducing the number of requests your applications need to make.
Filtering a Dictionary by value with a List as the value | no dogma blog Filtering out entries in a dictionary is not too difficult when the key and value are simple. For example if you had - IDictionary oneToFourDictionary = new Dictionary {{ "one", 1 }, { "two", 2 }, { "three", 3 }, { "four", 4 } };
Selectively Caching Values Inside HttpResponseMessage with Polly – caching series 3/3 | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. This is the last of three posts on caching with Polly. The first showed how to selectively cache HttpResponseMessages based on the status code of the response.
Transcribing Two Speakers with Amazon Transcribe via Speaker Identification with .NET | no dogma blog Amazon Transcribe provides two ways to identify speakers in a piece of audio. In this post, you will see how to use speaker identification to distinguish between the voices of two people.
Web API 2 Controller with multiple get methods | no dogma blog I have two other posts on multiple GET methods, one for ASP.NET 5 Web Api, and another for Web Api 2. It seems that every version of Web API changes how it handles default routes or route prefixes or whatever the next name will be.
Simple Deserialization of JSON from a File in C# | no dogma blog This is one of those posts that I write for my future self. Here's how to deserialize JSON from a file in C#. It also lists multiple ways to create the C# model from the JSON.
Skipping ActionFilters in ASP.NET MVC | no dogma blog Full source code here. In the previous post I showed how you can use an action filter to execute code both before and after an action method and how to apply the filter globally.
AWS .NET Tools and Templates for Command Line | no dogma blog If you are developing .NET applications for AWS there are many command line, and `dotnet` tools and templates that will help you. Here is a brief list, with install instructions.
Polly and Blazor, Part 3 - Dependency Injection | no dogma blog Using Polly with Blazor is simple, as I've shown in the previous two posts. In this, I will define the Wait and Retry Policy in the `Startup`, add it to the service collection and use dependency injection to pass it into the Razor page.
Adaptive/dynamic page numbering in c# | no dogma blog If you need to show many results (tens, hundreds or thousands), in a paged manner, you won’t want to display links to all those pages. I looked online for some c# that would adapt the number of page links shown to with the number of pages returned, but fo...
Getting Started with Elasticsearch, Part 3 - Deploying to AWS with Pulumi | no dogma blog Full source code available here. This is part 3 of my short introduction to Elasticsearch. In the first part I showed how to create an Elasticsearch index, mapping, and seeded it with data.
dotnet new failing with Error: Invalid parameter(s) | no dogma blog If you are using Visual Studio Code and you want to add a new project to your workspace, the easiest thing to do is something like - dotnet new xunit -f netcoreapp2.
Dependency Injection of an Entity Framework Context within Program.cs Using Top Level Statements | no dogma blog I have been a fan of Entity Framework for many years, and have relied on using the context within the `Configure(..)` method in Startup.cs, but that is not available when using top-level statements. This post shows how to use the context within `Program.c...
DynamoDb, Reading and Writing Data with .Net Core - Part 1 | no dogma blog Full source code available here. A few weeks ago I started playing with DynamoDb in a .NET application. I read through the AWS documentation but felt it was incomplete and a little out of date.
A Few Ways of Pattern Matching with C# | no dogma blog A follow up on an earlier post showing a few different ways to use pattern matching.
Finding and Killing .NET Processes that you Disconnect from Instead of Stopping while Debugging on Windows | no dogma blog Sometimes I accidentally "Disconnect" from a debug session instead of "Stopping" it. When this happens you leave behind a running process, holding on to files and preventing your starting a new debug session. Sometimes it also holds onto a port. Here I sh...
Simmy Chaos Engine for .NET – Part 6, Configuring Policies Dynamically | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. Simmy chaos policies have configurable options, via these options the polices can be turned on or off, have the rate at which they fire set, and in the case of t...
Using an mdf file database with Entity Framework Core 2 in Visual Studio 2017 | no dogma blog Full source code available here. If you want to play around with Entity Framework it can be a little frustrating to create a complex database with a lot of sample data.
C# and AWS Lambdas, Part 4 – Storing the Zip in S3, Setup with Pulumi IaC | no dogma blog In the previous post, I showed how to use Pulumi to create a Lambda, API gateway and upload a zip of Web API application directly to the Lambda. In the post I'm going to use S3 to store the zip of a simple .NET application (not a Web API app) and point t...
Unit Testing .NET Core 2 Web Api | no dogma blog Full source code available here. Unit testing Web API controllers in .NET Core 2 is very easy. I have very simple GET and POST methods. 1[Route("api/[controller]")] 2public class ValuesController : Controller 3{ 4[HttpGet] 5 public async Task<IActionResul...
Accessing AWS Secrets Manager from .NET Lambda Functions, Part 4 - Connected to a VPC, and using a NAT Gateway | no dogma blog In a previous post, I showed how to use a VPC Endpoint to give a Lambda function (which is connected to the VPC) access to Secrets Manager. In this post, I will show how to use a NAT Gateway to give a Lambda function access to Secrets Manager and the inte...
Ignoring JSON Key Casing and Numbers as Strings when Deserializing with System.Text.Json | no dogma blog When deserializing JSON from a console application or library, you have to handle unusual casing of JSON key names, and numbers represented as strings yourself. This is done with a couple of serialization options.
Reusing Polly Policies with Dependency Injection | no dogma blog Download full source code. Want to learn more about Polly? Check out my Pluralsight course on it. In my previous post “A simple Polly example with WebApi 2” I showed how to make a request to an unreliable endpoint protected by a Polly retry policy.
Locating and checking an executing DLL on a running web server or other application | no dogma blog Edit - even though the steps described below related to an example with IIS, you can use this technique for any running process, it’s just a matter of identifying the process id.
AutoMapper, ProjectTo() – Static Version | no dogma blog Full source code available here. I’ve been using AutoMapper for quite a few years, but one of the features that I like the most is the ProjectTo method. When using Entity Framework it lets me reduce the number of fields I query from the database to match ...
Hugo Aliases Workaround with Netlify | no dogma blog I love using Hugo and Netlify for my blog, but one thing I have not been able to get working is aliases, it might be because of a custom permalink I'm using, my slugs, or something else, but here is a workaround.
Arguments model and action methods in ASP.NET MVC Part 2 - using Glimpse | no dogma blog In my previous post I discussed how values sent from the browser are bound to objects in the action methods of a controller. If binding is not working as expected you need to examine the html element names and the types you are binding to, I showed how th...
Workaround for "Failed to create template" Error with .NET 7 RC1 and Lambda Functions | no dogma blog If you are Amazon.Lambda.Templates, version 6.3.0 or earlier with .NET 7 RC 1, you may get an error when creating new project templates. Read on for a fix or a workaround.
Polly Retry with Lambda Discards | no dogma blog Very quick post on using Lambda discards with Polly retries, includes an example with the HttpClientHandler too.
Entity Framework, checking the connection string of your context | no dogma blog Sometimes when using Entity Framework I want to verify that I’m connected to the database I think I’m connected to. Here’s how to check in Entity Framework 5, Entity Framework 6 and Entity Framework Core 1 (EF 7)
GitHub Actions with .NET, Part 5 - Build a .NET Application and Upload to S3 | no dogma blog In the previous post I used GitHub Actions and Pulumi to create an S3 bucket. This post shows how to build a .Net 5 application and upload the zip to the S3 bucket.
Using Build and Test Tasks from the Parent Directory of src/test with VS Code | no dogma blog I often follow the src, test directory structure for my .NET projects. But if you open Visual Studio Code to the parent of these directories, you can't use the build and test tasks without some modifications to the tasks.json file.
Using Amazon Polly to read a Dialogue from Julius Caesar | no dogma blog Amazon Polly can convert text to speech in a variety of voices. In this post, I'll use it to read a file containing a dialogue from the play Julius Caesar where Cassius and Brutus discuss Caesar, using a different voice for each speaker.
Programmatically get your AWS Account ID with .NET | no dogma blog It took me a little while to figure this out, so I thought I'd share.
Altering the ASP NET MVC model with an ActionFilter | no dogma blog Full source code here. Action filters are executed before and/or after the execution of an action method, they can be used to modify how an action executes or to perform a separate task, such as authorization or logging.
Getting Started with Elasticsearch, Part 2 - Searching with a HttpClient | no dogma blog Full source code available here. In the previous blog post I showed how to setup Elasticsearch, create and index and seed the index with some sample documents. That is not a lot of use without the ability to search it.
Executing a Method on All Implementations of an Interface | no dogma blog Full source code available here. Have you ever wanted to execute a method on all implementations of an interface? Say you have an interface called IGenerator and four implementations of it – GeneratorA, GeneratorB, GeneratorC, and GeneratorD.
ASP.MVC and Web Forms in one web application | no dogma blog I was recently asked to add an ASP.NET MVC 4 application to an existing Web Forms site. The ideal solution was to keep the code bases separate and the apps on a common domain.
Unit testing Entity Framework Core Stored Procedures | no dogma blog Full source code available here. Entity Framework Core has made unit testing CRUD functions much easier, see here for an example of using the In Memory Database, it allows you to search, add, remove and update rows.
Entity Framework Core and calling a stored procedure | no dogma blog Download full source code here. I thought this would be easy, there is a method called ExecuteSqlCommand which takes the stored proc name and an array of parameters. I wanted to pass in two parameters and get one back, no problem, I’ve done this with ADO.
Value cannot be null. Parameter name: constructor | no dogma blog Using Entity Framework I occasionally get the following error when reading from the database - `exceptionMessage=Value cannot be null. Parameter name: constructor` My Person class looked like this - 1 public class Person 2 { 3 public Person(string firstna...
Dynamically Updating the Request Header of a HttpClientFactory Generated HttpClient, Part 2 | no dogma blog Full source code here. This is a alternative to the approach described in a previous post. On a slack channel there was some discussion around the use of a little known extension method on HttpClientBuilder, ConfigureHttpClient.
Using Versions and Aliases to Pre-Warm Lambda Execution Environments when Handling Bursts of Traffic | no dogma blog In two recent posts I showed how to warm up execution environments for your Lambda functions so you can avoid the cold start penalty when you have a burst of traffic. In this post I'll show how to use Lambda versions and aliases to make this process easie...
GitHub Actions with .NET, Part 4 - Building an S3 bucket with Pulumi | no dogma blog With GitHub Actions, C#, and Pulumi it is easy to create an AWS S3 bucket, here's how.
Fluent Validation in ASP.NET Core 3.1 | no dogma blog Full source code available here. This is an update to a post I wrote in 2017 talking about Fluent Validation in ASP.NET Core. The example is the same but there has been few updates.
C# and AWS Lambdas, Part 7 – .NET 5 Web API inside a Container inside a Lambda, with API Gateway in front | no dogma blog In my previous post I showed how to build a .NET 5 library inside a docker image and deploy it to an AWS Lambda. This post is a small extension on that. I'm going to build a .NET 5 Web API application, turn it into a docker image, deploy it to an AWS Lamb...
Ordering of two Blog Posts on the Same Day with Hugo | no dogma blog There have been a few times when I wanted to publish two blog posts on the same day, but I wanted to be sure of the order they would appear in.
Making a column sparse with Entity Framework Migrations | no dogma blog I have a database built off code first models, but I want to set some of the columns to sparse. There isn’t a way to this with the fluent api or through annotations.
Using the Polly Timeout when making a Http Request | no dogma blog Full source code available here. Want to learn more about Polly? Check out my Pluralsight course on it. When making remote service requests the remote side will sometimes take longer than acceptable to respond.
Finding the Location of a Running Assembly in .Net | no dogma blog For many reasons you might want to know where a running assembly is located on your filesystem. I had to do this once when I was compiling classes at runtime and had a dependency on EntityFramework.
ASP.NET 5 Web Api Controller with multiple get methods | no dogma blog I have two other posts on multiple GET methods, both for Web Api 2. the first shows how to use routes like http://…/api/values/geta. the second shows http://…/api/values/22 or http://…/api/values/AAC1FB7B-978B-4C39-A90D-271A031BFE5D.
Arguments model and action methods in ASP.NET MVC Part 1 | no dogma blog Sending values from an MVC view to a controller works very well when you are binding back to the same model/viewmodel you populated the view with. But when you start trying to do something a little different, it’s not so obvious or straightforward.
A Web Server that Echoes Requests and Sometimes Faults with a 500 Error | no dogma blog I sometimes want to test how an application will handle errors when calling a web service. To do this, I built a simple echo server that responds to any HTTP verb on any URL. Some percentage of the time, the server will return 500 errors. It uses the Simm...
re:Invent Session on Refactoring Yesterday I had the honor and privilege of sharing the re:Invent stage once again with my good friend and colleague Runeet Vashisht for our session “Refactoring strategies for .NET applications as you migrate to the cloud” In this session, we were co...
How to use HttpClientFactory Inside Program.cs | no dogma blog Full source code here. Over the past week I have written a few articles about HttpClientFactory and dependency injection in .NET Core 2.1. There is one scenario I didn’t deal with - calling a HttpClient from inside the Main method in Program.
.NET 6 Web API in a Container in a Lambda | no dogma blog With the AWS tools and templates for Lambdas it is very easy to build and deploy a .NET 6 Web API application as a container image.
Letting a request fail with Polly | no dogma blog Want to learn more about Polly? Check out my Pluralsight course on it. Polly is fantastic for transparently retrying a request but there is always a point at which you must give up.
Finding and Killing .NET Processes that you Disconnect from Instead of Stopping while Debugging on Linux | no dogma blog Sometimes I accidentally "Disconnect" from a debug session instead of "Stopping" it. When this happens you leave behind a running process, holding on to files and preventing your starting a new debug session. Sometimes it also holds onto a port. Here I sh...
Using .NET 7 With Code Build Introduction AWS CodeBuild is one of AWS’s core development services for creating CI/CD Pipelines. CodeBuild is a fully managed service that helps developers to create automated builds of their development projects. With CodeBuild there is no develop...
GitHub Actions with .NET, Part 1 - Hello World and Downloading the Artifact | no dogma blog This is the first of a few posts on GitHub Actions. This first will be fairly basic, compile a Hello World application, zip up the binaries, and make them available to download. In future posts, I'll show how to add approvals and deploying to AWS, but for...
Hosting a .NET Core 2 Kestrel Server in a Windows Service | no dogma blog Full source code available here. If you have been using the Kestrel web server with Framework 4.x, you might already be hosting Kestrel inside a Windows service. But what if you want to use Kestrel with .
Using Multiple SSH Keys at the same time - GitHub, BitBucket, etc. | no dogma blog This is mostly a reminder to myself on how to store multiple SSH keys in my .ssh directory.
AutoMapper, ProjectTo() – Instance Version | no dogma blog Full source code available here. In my previous post I showed how to use the wonderful AutoMapper ProjectTo() feature, the demo code shown worked with AutoMapper up to v8.1.1. It looked like this –
Paging Through Files in an S3 Bucket with .NET | no dogma blog Here are two ways to page through files in an S3 bucket.
Polly with .NET 6, Part 5 - Using a Cancellation Token | no dogma blog Even when using Polly retries, there are times when you just want to give. The cancellation token is a great way to do this.
Polly, HttpClientFactory and the Policy Registry - choosing the right policy based on the HTTP request | no dogma blog Full source code available here. Want to learn more about Polly? Check out my Pluralsight course on it. The release of .NET Core 2.1 has made using HttpClient much easier. If you have been using HttpClient for a while you will know about its limitations a...
Removing Manually Installed .NET SDKs from Linux | no dogma blog For years I've been manually installing the .NET SDK on Linux. There is no automated way to remove them, but deleting everything and starting clean is very easy.
Support this site | no dogma blog If you found this blog or podcast useful, please help support it by buying me a coffee or by using this Amazon referrer link when you buy items from Amazon. Using this link does not affect the price of the items.
The terminal shell path "dotnet" is a directory - Visual Studio Code | no dogma blog I have been using Visual Studio Code in Ubuntu Linux for a while, but it was not an easy process to get it working the first time. I just got around to installing .
Streaming your IoT Data to DynamoDB Setting up your "Thing" in the AWS Console. This post is the third in my series IoT for the .NET Developer. You can find the companion video for this blog post here: Sending IoT Data to AWS IoT Core using .NET - YouTube. In the last post in this seri...
Building .NET 7 Applications using Amazon CodeCatalyst This past re:Invent AWS Launched Amazon CodeCatalyst the new All-In-One DevOps service. CodeCatalyst provides you with a single pane of glass to source control management, handling pull requests, issue management and software builds. CodeCatalyst use...
Polly, HttpClientFactory and the Policy Registry in a console application | no dogma blog Full source code available here. Want to learn more about Polly? Check out my Pluralsight course on it. How to use the HttpClientFactory with a console application is not immediately obvious.
Keeping your .NET Lambda Function Warm with Provisioned Concurrency | no dogma blog Cold starts with .NET AWS Lambda functions are a concern for some, but provisioned concurrency provides a simple and cost-effective way to keep your Lambda function warm.
Indexing the Works of Shakespeare in Elasticsearch - Part 2, Bulk Indexing | no dogma blog With Elasticsearch, indexing data in bulk is a more reliable and scalable approach than indexing a high volume of documents one at time. Here is how to achieve this with AWS Kinesis and a Lambda.
Opening new PowerShell Windows from PowerShell and Running Commands in them | no dogma blog Opening a new PowerShell window from an open one and running a command inside it was not as simple to figure out as I expected.
.NET 6 Custom Runtime for AWS Lambda | no dogma blog You can't yet run .NET 6 on AWS Lambda with the familiar managed runtime, but you can with a custom runtime. Here are the few small steps you need.
Mass Transit with RabbitMQ Hello World | no dogma blog Full source code is available here. Below is an example of how to use RabbitMQ with Mass Transit service bus. See here for instructions on how to install Rabbit MQ.
An exception of type 'System.MissingMethodException' occurred in System.Collections.Concurrent.dll | no dogma blog I left out version number in a package reference and got the exception - Exception has occurred: CLR/System.MissingMethodException An exception of type 'System.MissingMethodException' occurred in System.Collections.Concurrent.dll but was not handled in us...
Working with Lambda function versions | no dogma blog If you want to experiment with code variations for a Lambda function, try Lambda versions. In this post, you'll see how to deploy a stable and experimental version of the same function.
Indexing the Works of Shakespeare in Elasticsearch – Part 4, Searching via Web API in .NET 5 | no dogma blog This is part four of my four-part series on indexing the works of Shakespeare in Elasticsearch. In this, I'll show how to use the Elasticsearch "low level client" to perform the search. Previously, I wrote a [blog showing how to use a HttpClient](/2020/0...
Wowchemy, Changing from /post to /blog for Posts | no dogma blog By default, Wowchemy publishes blog posts to a /post path, if you want to change this to /blog or something else there are a few small changes needed.
Error converting the Lambda event JSON payload to type System.String | no dogma blog If you are getting this - "Error converting the Lambda event JSON payload to type System.String", you might need to serialize the payload you are sending. Read on to see how.
Streaming Results from Entity Framework Core and Web API Core | no dogma blog Full source code here. The code provided will not compile until you make a change in seeder.cs, the way it’s written it generates 500,000 rows in a local db. Set this to whatever value you want.
Unit Testing a Method That Uses HttpClient | no dogma blog Full source code available here. In this post I’m going to show you how to test an action method of controller that uses a HttpClient. When performing this test you want to isolate just the code of the action method for testing, you want to remove the dep...
Entity Framework non null foreign key migration | no dogma blog Full source code is provided. Overview This post gives a quick overview of how to use Entity Framework migrations and a detailed example of how to handle the addition of a new non null foreign keyed column to an existing table with data in it.
Using MediatR with API Endpoints | no dogma blog The mediator pattern is very helpful for keeping business logic out of your API endpoints. This post provides a simple example of this with the MediatR library.
Multiple Get Methods with the Action Method Selector Attribute in .NET Core | no dogma blog Full source code available here. In .Net Core Web Api it is not possible for the routing mechanism to distinguish between the following action methods. public string GetSomething(int id, int something) and public string GetAnother(int id, int another)
CastleWindsor chained dependency | no dogma blog Source code is available here. I recently had a problem where I wanted an MVC controller to use constructor injection of specified dependency and have that dependency load another specified dependency using Windsor.
Deserializing to an enum | no dogma blog I have an application where I deserialize an xml stream from a third party. One of the fields is a task code which can be one of only three values, insert, update and delete.
Why I blog | no dogma blog I’ve been developing software for some years and found that simple usually beats complicated and pragmatic choices beat dogmatic ones. In this blog, I want to share some useful pieces of code and ideas.
C# and AWS Lambdas, Part 1 - Hello World | no dogma blog First in a series of posts on using .NET with AWS Lambdas. It will start with the simplest example that converts a lowercase string to an uppercase string, but by the end, you will be running a .NET Web API powered by Lambda, fronted by an API gateway whe...
Amazon CodeCatalyst Development Environments If you are like me, you like to be able to write code anywhere. While I pretty much always have my laptop set up with development tools, I also have a bad habit of not pushing my changes when I get done. I then pull out a different device and get rea...
Running SQL Server in a Container | no dogma blog Over the years I've hesitated to add SQL Server to my laptop because of its size, but now it's easy to run in inside a container with a single command.
Registering Multiple Implementations of an Interface with Service Collection in ASP.NET Core | no dogma blog Full source code here. This is a simplistic approach to the problem and assumes that the dependencies created by the factory do not in turn have their own dependencies. This deficiency could be mediated by passing those dependencies into the factory.
Streaming Results from Entity Framework Core and Web API Core – Part 2 | no dogma blog Full source code available here. Some time ago I wrote a post showing how to stream results from Entity Framework over Web API. This approach a few benefits – the results would not be materialized in the API code, a small amount of memory would be used ir...
Using the HttpClientInterception to Test Methods That Use a HttpClient | no dogma blog Full source code available here. In my previous post I showed a way of testing a controller that uses a HttpClient. I had to mock the HttpMessageHandler pass that to the HttpClient and set a bunch of properties.
Extracting Form Fields from a Multi-Page PDF with Amazon Textract and .NET | no dogma blog This post shows how to extract key-value pair from fields in a multi-page PDF with Textract.
The type 'xxxx' is defined in an assembly that is not referenced. System.Runtime. | no dogma blog If you recognize the error from the title of this post, you can jump to the solution. The problem I have a ASP.NET 5 solution with two projects, a web application project and a class library project.
How to Dependency Inject a Service from Startup back in Program | no dogma blog Full source code here. While writing some recent blog posts on HttpClientFactory I had to work with some of the obscure features of ServiceCollection and dependency injection in .NET Core 2.
Simple Func<T> and Func<T1, T2, TResult> Examples | no dogma blog Full source code available here. About a month ago I wrote a post with a simple explanation of how to use methods that take Action or Action<T> as parameters. Actions themselves take 0 to 16 parameters and return nothing.
How To Run .NET 6, Kestrel, and Web API, on an AWS EC2 Windows Instance | no dogma blog In this post I show how to get a .NET 6 Web API application up an running on a Windows instance in AWS, and how to make the instance accessible to the web.
Requesting Data from two Data Stores in Parallel - Cache and Database | no dogma blog There are times when firing off the same query in parallel to two or more data stores is a good choice, keeping the first response, and canceling the other requests. Here I show how a achieve that even if the Task<> types are different.
Using a Stream Extension Method to Read Directly from a Stream into a String | no dogma blog I always forget how to read from a stream to a string, so I've create an extension method that does that and works with all stream types.
Saving Enums with Entity Framework Core | no dogma blog Full source code here. A few years ago I wrote a post about saving enums to the database with Entity Framework. It was able to save the enum as a string to the database and when reading from the database it was able to take that string and populate the en...
Blazor, Updating or Refreshing the Display During a Method Call | no dogma blog It is possible to refresh or update components on a Blazor page asynchronously in response to a task or tasks completing, here is an example.
Zipping Files From the Command Line in Windows 10 | no dogma blog It is strangely difficult to zip files from the command line with Windows 10. I spent an hour going round in circles between what you should be able to and what you can actually do. Here is a simple solution...
Lambda Function URLs - triggering .NET 6 Lambda functions with a HTTPS Request | no dogma blog Lambda Function URLs are a very easy way to make a Lambda function executable via an HTTPS request, they deploy in seconds, and can scale to your needs.
Why you should use IDictionary, IList, etc | no dogma blog Summary When returning objects from a method try to use IList, IDictionary, etc instead of List and Dictionary. This is especially important when the method is inside a class library which you distribute.
Accessing the Internet from VPC Connected Lambda Functions using a NAT Gateway | no dogma blog When a Lambda function is connected to a VPC, the function can no longer access the internet. One way to resolve this is to use a NAT gateway, read on to see how.
Setting the Kestrel Port from appsettings.json | no dogma blog Full source code available CoreWithKestrelFromConfighere. In my previous post I explained how to host Kestrel web server running on (the default) port 5000 as a Windows service. But what if you want to run the server on a different port?
How To Run .NET 6, Kestrel, and Web API, on an AWS EC2 Linux Instance | no dogma blog This post is very like the previous, getting a Web API application using .NET 6 and Kestrel up and running on an EC2 instance, but with Linux this time.
Creating an Automation Document Using C# and CDK Introduction When you are looking to deploy infrastructure into an AWS Account, one of the best practices is to use Infrastructure as Code (IaC). This is a recommended approach because it allows the process to be repeatable, and traceable. It also al...
Let's Encrypt Cert Error and Polly Retry | no dogma blog Let's Encrypt updated their root cert recently and now calls from some systems to APIs that use Let's Encrypt certs are failing. Here's one way to fix it with Polly and the HttpClientHandler.
DynamoDb, Reading and Writing Data with .Net Core – Part 2 | no dogma blog Full source code available here. A few weeks ago I posted about reading and writing data to DynamoDb. I gave instructions on how to get create tables on localstack and how to use the AWS Document Model approach.
Calling Generic Methods Using Reflection | no dogma blog Full source code here. Accessing generic methods by reflection is not easy. A while ago I needed to do just that and found relatively little information out there. So I dug in and figured it out for myself.
Dependency Injection of a Type within Program.cs Using Top Level Statements | no dogma blog There are times when you will want to use something from the service collection within `Program.cs`, in this post shows how to do that when using top-level statements
Dependency Inject a Service from Startup back to Program in .Net Core 3.1 | no dogma blog Full source code available here. Over the past couple of years I wrote a few posts about Dependency Injection in .Net Core 2.1, and this week I received comments from a reader telling me that some of the changes in .
Fluent Validation with Web Api 2 | no dogma blog Full source code here. I wrote blog post in 2015 on using the Fluent Validation NuGet package for complex validation needs. In the post the validator checked that a create person request had at least one active primary phone and at least one active primar...
Using Memcached with a .NET Console Application | no dogma blog Getting Memcached running with a .NET Console application took a little longer than expected. If you are trying to do the same this might save you half an hour of messing about with constructor parameters.
WhenAny with Two Different Types of Task and Waiting for Both to Finish | no dogma blog If you use WhenAny with different types of Task you may want to do something when the first finishes, but also wait for the second to finish. Here's how.
Adding ROWGUIDCOL to Entity Framework Code First using migrations | no dogma blog To add add a ROWGUIDCOL to a unique identifier in a table using code first you have to use code migrations. Below is the snippet you need. I haven’t covered how to perform a migration because there are plenty of articles available.
Simmy Chaos Engine for .NET – Part 4, Doing Some Real Damage, Dropping a Table | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. Up until now the Simmy examples I’ve written have thrown exceptions, changed successes to failures or slowed down a request.
Selectively Caching a HttpResponseMessage with Polly - caching series 1/3 | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. When I give talks on Polly I show how to use it in a Web API application that calls another Web Api application.
.NET 6 Lambdas on ARM64 - Part 1, Functions | no dogma blog It is very easy to run .NET 6 AWS Lambda functions on ARM64 processors, read on to find out how...
Accessing the HttpContext from the Constructor of a Controller or a Dependency | no dogma blog Full source code here. There are times when you may need to access the HttpRequest from places that it is not normally available such as the constructor of a controller or the constructor of a service that is built by dependency injection.
How to install .NET Framework 4.7 in Visual Studio 2017 | no dogma blog Microsoft just released .NET Framework 4.7, but surprisingly it is not the easiest to install. Here are the steps for Windows 10, as of this writing, it is not available for earlier versions for of Windows.
Getting Web API Exception Details from a HttpResponseMessage | no dogma blog The Problem It’s hard to get the details of an exception from a Web Api response when calling Web Api from a C# program. (Skip to the solution if you don’t care about the background), it even handles inner exceptions!
Extracting Text from an Image with Amazon Textract and .NET | no dogma blog Occasionally you need to extract text from an image. Amazon Textract makes this easy. In this post, I'll show how to use it to extract text from a single image.
Securing Lab Environments Part 1 One of the great things that operating in the cloud allows us to do, is create lab environments. With Infrastructure as Code (IoC) tools, it makes it really easy for users to create preconfigured lab environments to try new things, and experiment wit...
Web Api 2 Without MVC | no dogma blog Download full source code. When building a Web Api 2 application there is much unneeded MVC baggage that comes along with it. To start with all the css, html and javascript can go, then most of the packages, most of referenced dlls and almost all the C#.
Passing Configuration Options Into Middleware, Services and Controllers in ASP.NET Core 3.1 | no dogma blog Full source code here. I recently hit a problem where I needed to reload configuration settings as they changed, fortunately, this is relatively straightforward when using the IOptionsMonitor, in .NET Core.
How to fix 'No database providers are configured' when scaffolding a controller in ASP.NET 5 | no dogma blog If got this error when trying to scaffold a new controller (MVC and Web Api) for an ASP.NET 5 web app using Visual Studio 2015. There was an error running the selected code generator: 'No database providers are configured.
Registering Multiple Implementations of an Interface in ASP.NET Core with Autofac | no dogma blog Full source code here. A few weeks ago I wrote a post about using dependency injection to pick between two implementations of an interface. It was a solution I was not very happy with because it meant I had to new up the implementations inside a factory o...
Performance Comparison of Entity Framework Core 2.1 and Dapper 1.5 | no dogma blog tl;dr - ignore most (maybe all) of the posts out there comparing Dapper and Entity Framework performance, you need to measure it yourself. Here’s why - Some are angry opinion pieces from people who don’t like one technology or the other and clearly haven...
Entity Framework Core 3.1 Bug vs 2.2, Speed and Memory During Streaming | no dogma blog Full source code available here. A while ago I wrote a blog post about the advantages of streaming results from Entity Framework Core as opposed to materializing them inside a controller and the returning the results.
Working with JSON in .NET, a better way? | no dogma blog Full source code available here. Two recent experiences with C# and JSON frustrated me with how difficult it is to work JSON inside an application. I have also been learning Node.
Simple Action and Action<string> Examples | no dogma blog Full source code available here. A junior engineer colleague of mine recently asked me “how the f* * * do I call this method?”. Seemed like a reasonable question. It was a method that took a complicated Func and an Action with a series of parameters.
C# and AWS Lambdas, Part 6 – .NET 5 inside a Container inside a Lambda | no dogma blog A few months ago AWS released a feature allowing Lambdas to run container images, for larger applications this is easier to work with than a zip file or set of layers, it also lets you move your already containerized apps to Lambda with a small effort. Th...
Getting Error Messages and Status Codes from Typed HttpClients | no dogma blog Full source code here. I have been using HttpClientFactory for a while and have generally preferred using named clients over typed clients. With a named client you get the HttpClient just before you are going to use it, and you have full access to the Htt...
Using JSON to store application preferences and configuration | no dogma blog Download full source code. Storing configuration preferences in the database is not a hard task. It usually involves storing the name of the preference, the value and the type in the database.
Starting the Presenter View in PowerPoint | no dogma blog When practicing a presentation on a single screen it is helpful to see the notes, next slide, time information, etc., that you normally get with multiple monitors. This can be done with the Presenter View.
The Simplest S3 Upload Example with .NET | no dogma blog A simple example of uploading a file to S3 with .NET using a few lines of code.
Simple Lambda Function with a Function URL | no dogma blog This is a simple Lambda function that uses a Function URL. This blog post will be referenced in more complicated examples.
Using Step Functions and C# Lambdas to Orchestrate API Calls | no dogma blog I've been playing with Step Functions for a while and wanted to see if I could use them to orchestrate a bunch of API calls, processes the responses, make decisions, etc. This post shows how to combine a single Lambda, HttpClient, and Step Functions to ac...
Entity Framework Migrations with an existing database | no dogma blog Introduction If you read my post on Entity Framework migrations, you might be saying, “that’s amazing, but that’s all very well for new projects, but we’ve got eighty tables in place already and that code first migration ship has sailed”.
Printing on the Spot in a Console | no dogma blog For the sheer fun of doing a little silly programming...
Polly with .NET 6, Part 1 - Dependency Injection of a Policy into a Controller | no dogma blog This post shows how to use Polly with .NET 6 if you are taking advantage of top-level statements.
Securing Lab Environments Part 2 In my last post I wrote about securing your AWS lab environments by using Managed Microsoft Active Directory as an authentication provider and configuring that active directory with randomly created passwords. This is a great first step in helping to...
Using Other Verbs with Web API | no dogma blog Full source code available here. You will often use the GET verb when making requests to an API. You have probably used it like this - www.example.com/person/ or www.example.com/person/1 or www.
Adding a Test Task to the VS Code Command Palette | no dogma blog I thought it would be simple to add a task to run tests from the VS Code command palette, but it was not as straightforward as I hoped. Here's how to do it.
POST with HttpClient and Basic Authorization | no dogma blog Full source code here. A non .NET developer friend asked me to help him write a sample C# application that exercises a POST endpoint he wrote, it requires Basic authorization. After a quick search, I found that there are relatively few good examples of do...
Serializing a stack to XML in C# | no dogma blog Serializing a class to XML in C# is straightforward; most collections can be easily serialized also. Something like the following will work in most scenarios - 1public string GetSerializedString<T>(T objectToSerialize) 2{ 3 var serializer = new XmlSeriali...
Installing Docker Desktop on Ubuntu 22.04 | no dogma blog I love using Docker when developing software, but installing it on Linux is not as simple as I had hoped. If you have hit the error "docker-desktop : Depends: docker-ce-cli but it is not installable" then this post is for you.
Alter response header in Web API to return machine name | no dogma blog Full source code available here. I recently hit a problem where I was getting incorrect responses from a server behind a load balancer. Looking at the logs didn’t help because there was no error.
Using Polly with Any Type of Request | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. I recently presented a talk on Polly at the DevUp conference in St. Louis.
Build, Zip, Update a .NET Core 3.1 AWS Lambda, and Run a Test, with a Single Command | no dogma blog I've been working on a small AWS Lambda that has needed many iterations, I quickly got tired of building it, zipping by hand from Windows UI, uploading from the AWS console UI, and executing a test from there. Here is a simple batch file that does it all...
Simmy Chaos Engine for .NET – Part 2, Resilience and Injected Faults | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. I wrote a blog on using a Simmy Fault policy a few days ago, it is very simple to use by itself, but it is far more useful when used in combination with a resili...
Redis Hello World with C# and .NET | no dogma blog A simple Hello World type application for Redis using C#.
Using Intrinsic Functions with Step Functions to Clean Json Strings | no dogma blog Working with Json directly in C# has always been a problem, but as Json becomes more common the problems mount. I was using AWS Step Functions recently and wanted to pass the Json string output from a Lambda running .NET Core 3.1. As with all things C# Js...
Re-authorization and onRetry with Polly | no dogma blog Full source code available here. Want to learn more about Polly? Check out my Pluralsight course on it. In a previous post I showed how to use Polly to make a simple call, retrying in the event of failure.
Connecting your RaspberryPi to AWS IoT In my last article "IoT for the .NET Developer", I covered how you can get .NET 7 installed and running on your RaspberryPi. In this article, I am going to cover how to get your Raspberry Pi set up and connected to AWS's IoT Core. There are two main ...
Hour of Code: I wanted to start the year with a post about one of my favorite activities. The organization Code.org has an annual event that they run called Hour of Code. The idea of Hour of Code is to have technology professionals like you and I go into the class...
Two Ways to Count the Number of Times a Mocked Method is Called With Moq | no dogma blog There are at least two ways to count the number of times a mocked method is called with Moq. The first is with the Verify method, the second is with the Callback method.
Complex model validation using Fluent Validation | no dogma blog Full source code is available here. A common problem is validating an object using a complicated set of rules. I started using the Fluent Validation package some time back, it is commonly used with MVC and Web API applications but can be used with in any ...
Using Entity Framework for .NET 6 with SQL Server in a Docker Container | no dogma blog Want to see how easy it is to use a SQL Server Docker container with Entity Framework for .NET 6?
A simple Polly example with WebApi 2 | no dogma blog Download full source code. Want to learn more about Polly? Check out my Pluralsight course on it. If you are calling APIs and you haven’t heard about The Polly Project, you should check it out.
Reusing HttpClient with Dependency Injection | no dogma blog Full source code available here. If you are using HttpClient to make requests for you, you might have come across some articles discussing how to reuse HttpClient. They strongly advocate for using a single HttpClient for as many requests as possible, i.
Transcribing Two Speakers with Amazon Transcribe via Channel Identification | no dogma blog Amazon Transcribe provides two ways to identify speakers in a piece of audio. In this post you will see how to use channel identification to identify speakers. In a subsequent post I will show how to use speaker identification for cases where you don't ha...
Entity Framework with Proper Foreign Key Names | no dogma blog Full source code here. One of the very nice features of Entity Framework is the navigational properties. But it is easy to set them up in a less that optimal way.
Web API 2 Controller with multiple GET methods - part 2 | no dogma blog I have two other posts on multiple GET methods, one for ASP.NET 5 Web Api, and another for Web Api 2. Download full source code. A few months ago I wrote a post explaining how to create a controller with multiple GET methods.
Simmy Chaos Engine for .NET – Part 7, Using a Random Chaos Policy | no dogma blog Full source code here. Want to learn more about Polly? Check out my Pluralsight course on it. This post builds on the previous one where I added chaos policies to a registry and dynamically configured their settings via a config file.
Simple Example of C# 9 Lambda Discards | no dogma blog Discards can now be used with Lambdas in C# 9. Here is a simple example.
Returning default values from a failed web request with Polly Fallbacks | no dogma blog Full source code available here. Want to learn more about Polly? Check out my Pluralsight course on it. In previous posts on Polly I showed how to use a simple retry, and a retry with a delegate that is called before the request is retried.
Extracting Key-Value Pairs from Document Form Fields with Amazon Textract and .NET | no dogma blog Textract can do more than just extract plain text, it can also identify fields in a form and extract the key-value pairs. In this post, I'll show how to use it to extract key-value pairs from a tax document.
IoT for the .NET Developer In this blog post, we are going to start the process of developing an Internet of Things (IoT) solution using .NET 7 on a Raspberry Pi. IoT systems often run a lightweight Linux OS and leverage ARM hardware with low-power processors and have small am...
C# and AWS Lambdas, Part 5 – Updating the Zip in S3 and Updating the Running Lambda, with Pulumi IaC | no dogma blog This post pulls together a few threads I've been working on - the creation of Lambda to run .NET, storing the zip in S3, and updating the .NET Lambda when the zip in S3 is updated. This one took quite a while to put together - the permissions, roles, and ...
Pizza Delivery IoT Project Pt. 1 Introduction There is an ongoing project each year for the Developer Advocates to build sample applications. This year my sample application is going to be built around an IoT use case. This project was the catalyst for my IoT for the .NET developer ...
Enum ToString(), Caching for Performance | no dogma blog Full source code available here. A while ago I was working on a program that had to convert enums values to strings as it saved data. When I removed the enum value from the data that was saved it went noticeably faster.
SSN checking and formatting | no dogma blog Here’s something I worked on a few days ago. It shows six ways of verifying that an incoming string has nine numeric characters and then returns a string in the standard social security number format.
Web Api Routing in .NET Core | no dogma blog Full source code available here. Routing in .NET Core Web Api (1.1 and 2) is a little different than in earlier versions. I’ve written about this a few times, you can find those posts here.
Make Your C# Code Simpler With Target Typed New #shorts Support me on Patreon to access the source code:https://www.patreon.com/milanjovanovicJoin my weekly .NET newsletter:https://www.milanjovanovic.techRead my B...
What is a Kubernetes Control Plane Components? #shorts What is a Kubernetes Control Plane Components? #shorts Let us connect:🌍 My website - https://mohamadlawand.com📸 Instagram - https://www.instagram.com/mo...
C# 12.0 Preview: Primary Constructors for Classes and Structs .NET, .NET Core, ASP.NET, ASP.NET Core, Visual Studio, Jaliya Udagedara
What's next for the Microsoft Fluent UI Blazor components? Coming up in the next major version: a clearer name, a new repo name, new components (a lot of them), a new domain name and more. Read on to learn about the why and how.
How to Use Code Behind for Blazor Components | 2 Solutions Usually, when we see Blazor components, the C# code handling the interaction for the component template is placed below the template within the same .razor f...
C# Is BAD At MATH!!! Can You Explain THIS? When maths and programming don't overlap, we might be in for some weird surprises! #shorts #csharp #dotnet #programming #programmingtips Join this channel to...
A .NET Discussion with Isaac Levin Remember: you can also always follow the show on Twitter @dotnetcoreshow, and the shows host on Twitter @podcasterJay or visit our Contact page. Welcome to s...
Generate QR Code in .NET MAUI In this article, I'm going to show you how to generate a QR code in .NET MAUI for Android and iOS...
Create an Azure Function with PowerShell and Visual Studio Code In this post, I'm going to show you how to create Azure Functions with PowerShell and Visual Studio...
Pro EP 45 : Since .NET 6 this file is the entry point of our application. It is doing work of both Program and Startup file if we look it via previous…
Code SQLTools Extensions And Code Docker Extensions Fritz wants to help you become a better developer. You can learn 31+ shortcuts and tricks for Visual Studio Code, as well as his favorite VS Code extensions,...
IaaC - Create full infrastructure on AWS with Terraform In this video we will be going to be exploring how we can create full infrastructure on AWS with TerraformSupport me on Patreon to access the source code:htt...
MassTransit Commute - Endpoint Dependencies In MassTransit v8.0.15, the ability to specify endpoint dependencies was added. Using this new capability, receive endpoints can be configured so that they d...
Welcome to Hell - Windows Publishing with .NET MAUI TL;DR if you have an idea on how to publish a .NET MAUI app as a single file for Windows, please let me know. I tried everything i could find on the internet in the docs and on GitHub but nothing work
.NET MAUI + Blazor Hybrid Tutorial for Beginners - Build mobile, desktop, & web apps with C# The first 1,000 people to use the link will get a 1 month free trial of Skillshare: https://skl.sh/jamesmontemagno04231 Let's start our journey together to ...
The #1 Mistake Devs Make When Moving To Microservices 💻Get the source code: https://youtube.dotnetmicroservices.com/microservicesmistake🔥Check out my free .NET workshop: https://dotnetmicroservices.com/worksho...
Streamline Your .NET Application Deployment with AWS AppRunner's Build from Code Feature Hi, I'm James. In this video, we will look at how you use the Build from Code feature of AWS AppRunner to automatically re-compile and deploy your applicatio...
VisualTransition and State Animations in WinUI and the Windows App SDK - Nick's .NET Travels One of the things that sets WinUI apart from other UI frameworks is that provides a declarative way to define visual states for a control or a page. It also allows for the transitions between states to be defined. In this post we’re going to cover how to ...
.NET MAUI at Build, in .NET 8 Preview 3, and more! | The .NET MAUI Podcast ep. 118 It's been a little bit... but James, David, and Matt are back with the latest .NET MAUI and Azure news! We are heading to Build and .NET MAUI is headed to .N...
Generate QR Codes and Other Barcodes with Camera.MAUI in .NET MAUI The Camera.MAUI plugin does much more than just taking pictures. For instance, it can also generate QR Codes and other barcodes! In this video I will show yo...
dotNetDave Rocks the Copenhagen Developers Festival 2023 I’m so excited to announce that for the first time, the For Those About To Code: World Wide Tour will be at the 2023 Copenhagen Developers Festival in Copenhagen Denmark! I will present my se…
C# and nullable reference types Nullable reference types are not new, but I love them so much that I had to do a video about them! And also the required keyword introduced in C# 11 improved...
Today’s random F# code: Using measures to give types more meaning We use NodaTime in our application to deal with time. As you may remember, time is very important in our application - it's a attendance time-tracking tool with duty planning and many more features. For example, we use Instant to model a point in time. Bu...
Saying Hello To The Newest .NET Community - WeAreDotnet! Subscribe to my DevOps Newsletter, Observed!: https://news.codewithstu.tv/In this first interview of a series, we're meeting the founders of WeAreDotnet, a n...
ABP React Template React Starter Template for ABP application with Next.js and Tailwind CSS is ready to use. You can use this template to start your next project.#react #nextjs...
Health Checks In ASP.NET Core For Monitoring Your Applications We all want to build robust and reliable applications that can scale indefinitely and handle any number of requests. But with distributed systems and microservices architectures growing in complexity, it's becoming increasingly harder to monitor the heal...
Domain Events | Clean Architecture & Domain-Driven Design from scratch | Part 17 Get the source code: https://www.patreon.com/amantinband.In today's video, we'll implement Domain Events from Scratch.We'll see why domain events are such a ...
From Dribble to .NET MAUI - XAML App DALL-E Challenge # 2 In this video, we will recreate a design of one of the pages of an artificial intelligence image generator application.Original Dribble design: https://dribb...
You NEED to Active this GitHub Feature NOW! 🤩💨 #shorts GitHub New Code Search and Code View Feature.💎 Be a Patreon to get the source code: https://patreon.com/gsferreira🚨 KEY LINKS🤝 Support me on Patreon (and ...
Create Your Own Chat App: SignalR Mastery in C# & ASP.NET #dotnet #csharp #tutorial #softwaredevelopment #signalR #aspdotnetcore #programming #softwareengineer #softwareengineering #softwareengineeringtutorials Upd...
How the new version of MediatR (12.0.1) might break your application Hi everyone. MediatR 12.0.1 was recently released and has some major changes. In previous versions, when we didn't need to return something from a handler, w...
Mastering Threading in C# Concepts and Examples Introduction Threading is a powerful technique that allows you to achieve better performance and…
Exploring HashiCorp Vault with Vault .NET Client Library Hello, everyone! How are you today? I hope you are doing fine. I'm so excited because this is my...
Introducing the 'Super Clean' Visual Studio - for Mac - extension! Visual Studio for Mac gets left out of the loop sometimes when we talk about extensibility, unfortunately. I decided to learn how, and this is my story!
Diagramming Finite State Machines with Mermaid.js Learn how to use markdown and Mermaid.js to illustrate finite state machines, hierarchical finite state machines, and UML state diagrams.
How to create a mobile app with .NET MAUI in 10 easy steps Aprende cómo crear una aplicación móvil utilizando .NET MAUI en solo 10 pasos sencillos. Aprende sobre las ventajas de usar .NET MAUI.
Pass a JSON Web Token (JWT) to minimal API using fetch() | BinaryIntellect Knowledge Base In the previous article we learned to call Web API and minimal API using fetch(). Many a times your APIs are secured using JSON Web Token (JWT) based authentication scheme. And you need to pass the JWT while making API calls. In this part of the article w...
Interesting links of the week 2023-17 (#69) Here are some interesting articles, blog posts, videos, podcasts, and GitHub repositories I’ve run into over the last week (April 17, 2023 - April 24, 2023)
gefs Recently, I have been working on a new file system called gefs. It isn't yet trustworthy, but it's ready for testing. The code is available here: https://shithub.us/ori/gefs/HEAD/f.html