I’ve decided to write this blog post when I came across an issue with Swashbuckle trying to validate JSON file in Swagger and was failing since Swagger’s online validator was trying to fetch JSON file from an development server which is not accessible from external networks.
Continue reading Swashbuckle and Swagger for .NET Core 1.0 validator issue.NET Core projects with StyleCop Analyzers
Different developers have different coding styles, however when you work as a team you want to make sure everyone can quickly pick up any part of code and could get their head around in no time. For this reason, it’s great when code has unified style. This can be done manually (not recommended :)) or by using code analyzers in Visual Studio. Default set of rules check for the most common issues, however do not keep the coding style itself unified. Therefore, such tools like StyleCop Analyzers become really handy in such cases.
Continue reading .NET Core projects with StyleCop AnalyzersFix SQL database user mapping
If you used a SQL login and needed to restore a database (dev/test), you should notice that your SQL login doesn’t work for the database anymore. The reason for this is that SQL login and database user mapping was lost. Even you can see the user name in database user’s mapping, however in internal SQL memory the restored database’s user has different reference than the SQL login.
SearchAllTables SQL Stored Procedure
Sometimes you need to find a specific string or value in a database that you are not familiar with. You may not know where to start since a completely new database for you, or there are just way too many tables. In such cases there is a very handy stored procedure that searches for a string through all the tables.
Continue reading SearchAllTables SQL Stored ProcedureTry … Catch in SQL
The best practice to run SQL queries is to run them in transaction and wrap with SQL’s Try … Catch statement, so we could rollback the transaction, and throw an exception. Below is the code snippet that would do it all.
Continue reading Try … Catch in SQLNUnit TestCaseSource example (advanced)
Just a quick reminder on how to set up TestCaseSource with NUnit. It can save a few lines of code when you want to test the same method using different sets of values. We will use TDD approach to implement our sample method and unit test it.
Continue reading NUnit TestCaseSource example (advanced)Microsoft Dependency Injection and MVC6
In my previous blog post I’ve implemented a very simple application to illustrate dependency injection (DI) using Ninject. While Ninject is flexible and powerful, you might want to try different dependency injection libraries before you make your final decision on what to use. And this time I wanted to look into the latest dependency injection library which comes as a default option for MVC 6 and .NET Core – Microsoft Dependency Injection. And yes, the name is very easy to remember :)
Continue reading Microsoft Dependency Injection and MVC6Ninject and ASP.NET MVC 5
It has been a while since my last blog post, and I decided to continue series of simple examples of dependency injection (DI). Last time I had an example of not so well known but extremely simple and fast Simple Injector. This time I wanted to replace the Simple Injector with a more popular Ninject, and see if there are any big differences in terms of set up. I chose Ninject mostly just because of the Japan-related name:)
Continue reading Ninject and ASP.NET MVC 5MCSD: Web Applications acquired
It has been a while since my last blog post… I’ve been busy acquiring the last piece in my MCSD puzzle – the 70-487 exam. And after a few non-stop weeks of studying MSDN and sharpening my EF querying skill, I passed the exam! Felt so nervous before clicking the “Finish” button…
Continue reading MCSD: Web Applications acquiredBlog post on Roll Out team at Madgex
Each team writes about a day at their team to represent life at Madgex. As a developer at Roll Out team I’ve decided to write a slightly more technical blog post about our daily challenges, and a few bits about myself. Happy reading!
Continue reading Blog post on Roll Out team at Madgex