no dogma blog
no dogma blog
Blog Posts
Podcast
Web API Lambda Course
Polly Course
Photos
Contact
Support this Site
About
RSS
Light
Dark
Automatic
C#
Using Intrinsic Functions with Step Functions to Clean Json Strings
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# Json string related, it was not easy.
Aug 25, 2021
#
AWS
,
Step Functions
,
JSON
,
C#
Two Ways to Count the Number of Times a Mocked Method is Called With Moq
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.
Jul 19, 2021
#
Mock
,
Moq
,
C#
,
Verify
,
Callback
Printing on the Spot in a Console
For the sheer fun of doing a little silly programming…
Jul 2, 2021
#
C#
,
console
Simple Example of C# 9 Lambda Discards
Discards can now be used with Lambdas in C# 9. Here is a simple example.
Jun 28, 2021
#
C#
,
dotNet6
,
dotNet
,
Lambda
,
Lambda Discard
VS Code Bug - Interpolation and Commented Lines, Workaround
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.
Nov 2, 2020
#
C#
,
VSCode
Working with JSON in .NET, Infrastructure as Code with Pulumi
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.
Oct 13, 2020
#
C#
,
dotNet
,
dynamic
,
IaC
,
Infrastructure of Code
,
JSON
,
Pulumi
Working with JSON in .NET, a better way?
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.
Oct 9, 2020
#
C#
,
dotNet
,
dynamic
,
Elasticsearch
Enum ToString(), Caching for Performance
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.
Jul 24, 2020
#
C#
,
Enum
,
ToString
,
Caching
Executing a Method on All Implementations of an Interface
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.
Jun 1, 2020
#
Activator
,
C#
,
CreateInstance
,
Interfaces
Simple Func<T> and Func<T1, T2, TResult> Examples
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.
Apr 10, 2020
#
C#
,
Lambda
,
Func
«
»
Cite
×