News for hackers. Stuff that matters.
Re:ASP.NET MVC and WebAPI Tutorials by nahname on Saturday October 06, 2012 @12:41PM (#4620949)
I've never understood their sick obsession with attributes. When I first started using MVC, I thought it was clever to add HttpPost, HttpDelete, etc... After using a real routing library and then bringing one into my MVC project, it just looks, well... stupid. Gone are my RPC method names. Gone are my untestable Http method -> Action routing. Gone are my magical behavior mixed in due to something in a square bracket.
Re:ASP.NET MVC and WebAPI Tutorials by AndrewNCarr on Saturday October 06, 2012 @02:05PM (#4621182)
There is nothing magical about attributes in C#, they are a well defined way to declaratively add meta data to your methods, and I've always found them quite useful and effective.

Here are a few links that may be insightful on how they work:

http://oreilly.com/catalog/progcsharp/chapter/ch18.html

http://msdn.microsoft.com/en-us/library/aa288454%28v=vs.71%2...

http://www.codeproject.com/Articles/2933/Attributes-in-C

Re:ASP.NET MVC and WebAPI Tutorials by vyrotek on Saturday October 06, 2012 @12:53PM (#4620979)
What's this real routing library you speak of? I actually just started using an Attribute Routing [1] library for my WebAPI project. I like having my routes defined on the methods that will handle them instead of hidden away in the global.

[1] https://github.com/mccalltd/AttributeRouting

Re:ASP.NET MVC and WebAPI Tutorials by andywhite37 on Saturday October 06, 2012 @02:28PM (#4621254)
I used AttributeRouting for a fairly large ASP.NET MVC 3 project. I found it really clean and useful - I preferred having the routing information declared on the methods themselves, rather than in some generic routing table, or a single catch-all route. With this library, you don't have to explicitly define a route on every method, there are convention-based approaches, and different levels at which you can define the base route, then more specific routes as you get closer to the methods themselves.

I also used T4MVC, which may have fallen by the wayside, but that kept a lot of the "magic strings" out of the code.

http://mvccontrib.codeplex.com/wikipage?title=T4MVC

Re:ASP.NET MVC and WebAPI Tutorials by nahname on Saturday October 06, 2012 @01:00PM (#4620999)
RestfulRouting is nice

Edit: That library looks pretty good as well. It does come down to a personal preference thing.