Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple return points - is it OK practice?
Message
From
01/02/2013 15:39:55
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01564936
Message ID:
01564957
Views:
55
This message has been marked as a message which has helped to the initial question of the thread.
I have controller methods where sometimes I return a View and othertimes I RedirectToAction. So, two returns are required.

>I agree and I've decided to use early exit points. I've checked a few procedures coded by my colleagues - they used early exit points. I also believe this is part of ASP.NET MVC - I've seen lots of conditional return code in the Controller's code. Otherwise I was getting lost in all these if else statements although I coded a few of the methods this way - only 1 exit point.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform