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.
Running microservices under HTTPS locally and in development environment with several domain names requires to have self-signed multi-domain SSL certificate. Also, starting from Google Chrome v58 SSL certificates are required to have SAN specified to avoid any SSL warnings. Luckily, there is a PowerShell script to make it quick and easy.
I needed to use the same C# enum in Knockout component view model to keep them both consistent. Also, this means less code duplication and no hardcoded values. The Knockout’s view model was in a component, therefore I decided to pass enum as a parameter from Razor view.
With the new Visual Studio 2017 out you might have been busy upgrading your .NET Core solutions to the new format and accidentally found out that StyleCop Analyzers stopped working? Automated upgrade will just upgrade projects, however will not adjust Visual Studio 2017 StyleCop Analyzers settings. Therefore, I’ve updated my template’s source code and added this quick guide.
Recently I cam across an issue when making HTTP DELETE or PUT requests to API would result in “405 method not allowed” error. After a quick research it turned out to be WebDAV component’s doing in IIS. Let’s re-create this issue locally, and learn how to solve it.