Category Archives: C

Dependency Injection Is NOT The Same As The Dependency Inversion Principle

A long time ago, when I first started blogging with LosTechies, I wrote up a few posts on Dependency Inversion and Dependency Injection, and how I finally started to understand what Dependency Injection was all about. At the time, I thought … Continue reading 

Also posted in C#, Principles and Patterns, Ruby | 10 Comments

Don’t Do Role-Based Authorization Checks; Do Activity-Based Checks

I’ve built a few dozen security mechanisms in my career. Unfortunately, I kept getting it wrong, hence the need to keep building them. Over the years, though, I learned a number of different ways that a security system can be … Continue reading 

Also posted in .NET, Analysis and Design, AntiPatterns, C#, Model-View-Controller, Rails, Ruby, Security | 51 Comments

MassTransit v2.0 Beta Available Now on NuGet!

After what seems like a long slumber, along with work being done on other projects such as Topshelf and Stact, it is our great pleasure to announce the first beta release of MassTransit v2.0. What originally started out as a … Continue reading 

Also posted in Philosophy of Software, Principles and Patterns | 3 Comments

Another source for LINQ extensions

While poking around for LINQ extensions, I found a project on Google Code, morelinq, that has *numerous* LINQ extensions from some rock-star authors like Jon Skeet, such as: Batch Concat Consume DistinctBy Pad Pipe Scan TakeEvery Zip And many more.  … Continue reading 

| Leave a comment

Versioning strategies for the sane

I don’t know why I didn’t think of this one earlier, it makes so much sense.  A coworker of mine shared a fantastic assembly versioning strategy that eliminates all of the decisions about major/minor version numbers we have to make … Continue reading 

| Leave a comment

Prototyping with anonymous classes

In the last post, I presented a rather strange bit of code: public static class ExpressionExtensions { public static Expression<Func<T, TResult>> Expr<T, TResult>( this T item, Expression<Func<T, TResult>> expr) { return expr; } } It looks like a rather pointless … Continue reading 

| Leave a comment

Trivia Friday

Everybody loves a cliffhanger, right?  I found myself needing to write the following code the other day: public static class ExpressionExtensions { public static Expression<Func<T, TResult>> Expr<T, TResult>( this T item, Expression<Func<T, TResult>> expr) { return expr; } } Why … Continue reading 

| Leave a comment

Autoprojecting LINQ queries

Something I’ve been looking at adding to AutoMapper was the idea of doing automatic query projection in the Select query projection in LINQ statements.  One downside of AutoMapper is that projection from domain objects still forces the entire domain object … Continue reading 

| Leave a comment

Hiding Sensitive Information With A Base64 Encoded Dictionary And Binary Serialization

I’ve been back in C# land for the last few weeks writing a small Winforms application that runs from a USB thumb drive.   Need To Hide Some Data? We have a need to store some slightly-sensitive information that changes … Continue reading 

Also posted in .NET, C#, Data Access | 2 Comments

Good Refactoring / Patterns For Simple UI Logic?

I’ve got a chunk of C# that sits inside of a very simple form. The form downloads an update from a web page – one of two possible downloads, based on which one is available – and shows a message … Continue reading 

Also posted in .NET, C#, Pragmatism, Principles and Patterns, Refactoring | 7 Comments