sfeldman.NET

.NET, code, personal thoughts

Browse by Tags

All Tags » C# (RSS)
Moq – ToString() Method Pitfall
I was working on some code today, when run into a pitfall with Moq. This was probably my misreading of documentation. The component I was testing looked somewhat like the code below public class SomeOtherType { private readonly ISomeType someType; public...

Posted by Sean Feldman | 5 comment(s)

Filed under: , ,

“Light Weight” Base Classes
Base classes are a touchy subject . Some might advocate for it, some will against it. Personally, I am not a big fan of base classes. There are several reasons for that, but most important to me, is the baggage you get to carry around once extend a base...

Posted by Sean Feldman | 1 comment(s)

Filed under: ,

Switching IoC Container with LINQ Expressions
Several last projects I used a simple IoC container, leveraging Activator.CreateInstance(type). The main reason - simplicity. Once there was a need to go to a higher level, I would switch to Windsor Container. One of the projects used Unity. The only...

Posted by Sean Feldman | 3 comment(s)

Filed under: ,

Enumerations And Extension Methods
Enumerations are for enumeration. Obvious. Often, though, it's used also for some metadata knowledge. For example, an enumeration for gender might look like: public enum Gender { Male, Female } .csharpcode, .csharpcode pre { font-size: small; color: black;...

Posted by Sean Feldman | 1 comment(s)

Filed under:

More Posts