Browse by Tags

All Tags » C# (RSS)
I was going back through an application I am currently working on for a client and trying to come up with a way to bridge a gap between that application and a new web site they want, which has two separate application architectures and ORM solutions....
Posted by bmains | with no comments
Filed under: ,
I been thinking about when I should differentiate between methods and properties. For instance, suppose that I have the following class: public class OrderProcessor { public bool RoundToNearestCent { get; set; } public bool RoundDown { get; set; } } This...
Posted by bmains | with no comments
You may have already noticed that it's harder to debug errors that occur within a Lambda expression. For instance, if you have this Lambda expression: var entries = collection.Where(i => i.EndDate.Value >= new DateTime(2008, 2, 1)); Notice the...
Posted by bmains | with no comments
Filed under: ,
When designing your applications to expose list-based data, there is a difference between styles of programming. For instance, suppose you wanted to expose a collection of objects to the consumer. This could be simply done using the following class: public...
Posted by bmains | with no comments
VS provides a debugging challenge when it comes to inline property declarations as such as this: DataRow row = table.Rows[0]; var obj = new SomeClass { ID = GetValue<int>(row, "ID"), Name = GetValue<string>(row, "Name"...
Posted by bmains | 1 comment(s)
Filed under: ,
This is one common variant to the strategy/state pattern that I commonly use. It varies in that I use a second object to actually figure out which stategy/state pattern object should be used in a given situation. For instance, suppose we had the following...
Posted by bmains | with no comments
Filed under: ,
I've been asked: "why use dynamic"? I admit, there aren't a lot of areas where dynamic is really needed. But there are some, and while I'd recommend limiting use of the dynamic keyword, I would never suggest not to ban it. One of...
Posted by bmains | 1 comment(s)
Filed under:
Microsoft had some interesting presentations at the PDC in Los Angeles. Some of the newest features are (found from this http://channel9.msdn.com/pdc2008/TL16/ ) The new dynamic keyword, which allows for dynamic invocation of methods that you don't...
Posted by bmains | with no comments
Filed under: ,