Code Complete, 2nd edition. It’s about the construction of software and the design that goes in the small parts of the code you write. The book is huge, so reading it might take a while, but it’s still very relevant and useful. The Clean series (Code, Coder, Architecture), those 3 books deal with different aspects of the … Read more Books

Replace switch statement with strategy pattern

using NLog; using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Net; using System.Net.Http; using System.Net.Http.Formatting; using System.Web.Http.Filters; using TaxMs.DTOs; using TaxMs.Infrastructure.CustomExceptions; using TaxMs.Infrastructure.Extensions; namespace TaxMs.ApiNet.Filters { public class AlertServiceFilter : ExceptionFilterAttribute { private readonly Logger _logger = LogManager.GetCurrentClassLogger(); public HttpStatusCode GetStatusCodeFromException(Exception exc) { if (exc is ArgumentException || exc is FileNotFoundException) return HttpStatusCode.BadRequest; if … Read more Replace switch statement with strategy pattern

How to ignore files (untrack) that have already been committed to GIT repository

If your GIT repository is tracking files that you want to ignore (i.e. you init your repo without .gitignore file) then these files still be present in you repository index also after adding them to the just created .gitignore file. Step 1 – Create (or modify) .gitignore file If you need an helping hand go … Read more How to ignore files (untrack) that have already been committed to GIT repository

Categories Git

IIS Routing

I was getting a 404 error when calling an apparently well configured Web API endpoint routing. I solved this issue by editing the node in web.config file adding this line: … …