Give The Iron (Page 3)

Full Throttle Development

Injecting ILogger like all the cool ASP.NET Core kids

Just about every service class used in our ASP.NET Classic sites need a logger. The Nlog way to do that is to put this in your class

Read more...

C# - Using references as key in Dictionary

A Dictionaryis used to do quick* lookups of a value using a specific key. Any type can be used as both value and key but if you use your own custom type as a key you need to think of a few things. *Quicker then say a LINQ-query on a list like MyList.Where(x => x.id == id).Single();

Read more...

The importance of using - well using

In our company, like many others I'm sure, we have a lot of small utility apps filled with legacy code. For us legacy code means code that lacks unit tests, and is full of anti-patterns. Global variables, functions with 100+ lines of code, static classes doing the brunt of the work, and a naming strategy that includes such marvels as MyFunction(), litter the code. It's very easy to judge the code on these failures, but the code has been in production for many years. It might be held together with staples and duct tape but years of small necessary tweaks means it works well for what they are used for. Occasionally, however, I get reminded of just how fragile this code base is.

Read more...