Geeks With Blogs
Joe Mayo October 2010 Entries
Custom MVC Routes
One of the first things I build for a new feature in MVC is a controller, with actions. For the C# Tutorial at C# Station, I built a CSharpTutorial controller and began looking at what actions were necessary. Considering the tutorial is at 23 lessons and growing, it doesn’t make much sense to create that many actions; especially with the glaring redundancy. The solution in this situation is a custom route. The following route definition solves this problem by isolating a parameter, lessonNumber: ......

Posted On Sunday, October 31, 2010 11:07 PM

An MVC 3 Contact Form
Many sites have a contact form, instead of posting email addresses. Admittedly, email addresses are convenient for customers because they can use a mailto link that brings up their email client and allow them to start typing, archive the communication, and manage the thread. When I first started C# Station, that’s what I did; posted my email address for everyone. Holy cow, what a mistake. I received so much spam that my inbox was unusable. Fortunately, spam is more manageable these days, but it’s ......

Posted On Saturday, October 30, 2010 6:27 PM

C# Station Organization
C# Station has gone through multiple updates over the years. I started it on the 4th of July 2000, shortly after the first announcement of the C# programming language, hence the name. You can find analytical information on Alexa and the Wayback Machine shows screen shots of changes over time. Whenever you pop something on the Web without much thought, there can be true ugliness. The journey from plain text links to drop-down menus evolved from necessity because the number of pages grew from 1 to ......

Posted On Friday, October 29, 2010 9:47 PM

Named Arguments Can Improve Readability
Using named arguments everywhere is tedious and unnecessary, but can be applied as needed to improve the readability of your code. Here’s an example, using Directory.Delete() that helps document the meaning of a bool argument: Directory.Delete(pathToDelete, recursive: true); If Directory.Delete was your own code, you could re-write the parameter to use an Enum and get away from the bool code smell. However, Directory is a class in the .NET Framework’s System.Diagnostics namespace, which demonstrates ......

Posted On Monday, October 11, 2010 11:04 AM

Released LINQ to Twitter Beta v2.0.14
Yesterday, I released LINQ to Twitter Beta v2.0.14. This includes entities, bug fixes, and the new Raw Queries feature. Please visit the LINQ to Twitter page for more info: Joe

Posted On Tuesday, October 5, 2010 10:03 AM

Extensibility in LINQ to Twitter: Raw Queries
Today, I added a new extensibility feature to LINQ to Twitter, called Raw Queries. The Twitter API has historically changed suddenly and without warning, leaving 3rd party libraries, such as LINQ to Twitter deficient in full support. On occasion, LINQ to Twitter encounters bugs that leave users without a means for accomplishing specific tasks. Therefore, we need work arounds to allow users to quickly adapt to changes and new features. Raw queries include two points of extensibility: the ability to ......

Posted On Saturday, October 2, 2010 8:50 PM

Copyright © Joe Mayo | Powered by: