While working on a new ASP.NET MVC project, I had a simple objective: add a new record and refresh my View. After sifting through several sites I found several resources that lead me to accomplish my goal. I’ve compiled my result into a new sample MVC Application that I created in Visual Studio that you [...]
Author Archive
Using .NET 3.5 List.Distinct()
28 Apr , 2010
When I was working on a project today, I had a List of objects where I needed to grab objects that had a distinct property value (i.e. where MyObject.MyID is distinct).
I discovered the Distinct() method on the List and I had never used it before so I wasn’t sure of the syntax. After further review, I learned you can use the IEqualityComparer interface to specify how to determine if the object is distinct.
Using .NET 3.5 and Reflection to help with sorting a List
1 Apr , 2010
The other day I was looking to be able to sort a list of products (List<Product>). I was binding that list to a ListView and the client wanted to be able to sort the Products by Name (Z-A & A-Z) and by Price (Low-High and High-Low). I initially had something like this: public class SortProductsByPrice [...]
