Converting an ASP.NET View to a String

Sometimes you would like to get the contents of a view and store it in a string rather than render it as HTML. An example of this is if you want to compose HTML emails and you want to harness the power of the ASP.NET MVC infrastructure (which includes layouts, partial views, and models). In this post I will show you how to store rendered View content in a string.

Separating Business Rules from Data Access

Business rules can be mixed into data access code. This scenario is a violation of the Single Responsibility Principle, because the data access class would have to change if the business rules change. In this post I will show you how to separate the business rules from the data access code.