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
Posts
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
AutoMapper, ProjectTo() – Instance Version
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 –
May 15, 2020
#
AutoMapper
,
Entity Framework Core
,
ProjectTo
,
AspNet
AutoMapper, ProjectTo() – Static Version
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 the model I want to return to the caller.
Apr 27, 2020
#
AutoMapper
,
Entity Framework Core
,
ProjectTo
,
AspNet
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
Streaming Results from Entity Framework Core and Web API Core – Part 2
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 irrespective of the size of the data returned, the results would being steaming as soon as possible and the speed of the request was faster than doing something like .
Mar 20, 2020
#
AspNet
,
Entity Framework Core
,
Streaming
,
WebApi Core
,
WebApi
Simple Action and Action<string> Examples
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.
Mar 5, 2020
#
Action
,
Actions
Fluent Validation in ASP.NET Core 3.1
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.
Feb 22, 2020
#
dotNet Core 3.1
,
AspNet
,
Fluent Validation
The terminal shell path "dotnet" is a directory - Visual Studio Code
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 .
Feb 2, 2020
#
dotNet Core 3.1
,
Linux
,
Ubuntu
,
Visual Studio Code
,
VSCode
POST with HttpClient and Basic Authorization
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 doing this in .
Jan 17, 2020
#
Basic Authorization
,
HttpClient
,
POST
,
System.Text.Json
Simmy Chaos Engine for .NET – Part 7, Using a Random Chaos Policy
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.
Jan 3, 2020
#
Chaos Engineering
,
Polly
,
Simmy
,
Polly Registry
«
»
Cite
×