A quick working example of Covariance and Contravariance in generics for a reference of when in and out C# keywords can be used.
Recently I’ve run into an ASP.NET Core MVC bug when an HTTP request with multipart content-type and empty body would cause an unhanded IOException exception to be thrown in MVC framework. However, when sending an invalid request I’d expect to receive a 400 error response code.
In this blog post I will share my experience of assembling, programming, and testing Robi-kun. Robi-kun is a Japanese toy robot which comes in parts from 70 magazines subscription. I’ve picked up an existing and half-done assembly, tested the assembled components, and completed the assembly to bring the robot to life :)
I was setting up Amazon SQS client locally, and received No RegionEndpoint or ServiceURL configured exception. My goal was to load all AWS config values from environment variables together with a temporary session token, however I will go trough config file option as well. Apparently region value was not picked up by the Amazon SQS client.
This blog post shows a quick example of implementing custom authentication in .NET Core 2.0 to secure your Web API. And in most cases you do want to secure your Web APIs, even though they were internal (micro)services only. If you don’t have a proper Identity provider e. g. Identity Server in place, and just need a quick solution, then a simple option is to validate Authorization header against a hardcoded value.
If you’ve ever tried to change a default value of a SQL constraint you’ve probably noticed that you have to drop the constraint, and then re-create the constraint with a new default value. However, what if you found an auto-named SQL constraint, and you started wondering how your SQL script will work across different environments with different databases…
This is slightly unusual blog post for me, since I do PHP development only once in a blue moon :) A friend of mine asked to check why their WordPress website was throwing strange errors, and this turned out in a worm hunt – removing PHP.Anuna from a WordPress site.
From all different solutions for various problems I’ve implemented in the past I wanted to create a simple web application that I could get back to for reference any time, and this would be a fully working KnockoutJS web application. The idea was to implement a simple client contacts management application using .NET Core 1.1, Entity Framework Core 1.1, KnockoutJS, and MSTest + Jasmine for unit testing.
Recently I’ve been working on several small .NET Core web apps and was looking for two things. Firstly, a way to access Session in a data service directly, and not just by passing HttpContext reference down from controller. And secondly, log any unhandled exceptions that occur in the application. And the answer to both questions was IHttpContextAccessor interface!
Using RequireJS makes life easier injecting dependencies like data services into Knockout components. However, there is no direct way of unit testing calls to such data services and need a different approach to be able to create a jasmine mock for an injected data service.