I've got to the point (unintentionally) that I feel in some parts I'm doing too much within the view (.aspx) itself, too much formatting, concatenation, in one place a little regex replace.
I was starting to work on a new part and trying to improve my approach.. Then it hit me why don't I just make all my View Models (in /Models/ in .Web project) strings or a list of string at a push. Note: I'm not referring to my model/domain, but rather to specifically my ViewModel.
public class FinanceQuoteView
{
public string Provider;
public string Broker; // rather than Broker == null ? "N/A" : Broker.ToUpperCase();
public string Monthly; // rather than Monthly.ToString("C")
public string PaymentTerm; // rather than "1+" + PaymentTerm.ToString();
public string FreeInsurance; // rather than insuranceIncluded ? "Yes" : "No";
public string[] Restrictions;
}
For Form submission (adding editing) I use a seperate view model to feed the controller action (form model if you will in /Models/Form). So FinanceQuoteForm does contain doubles etc... built via a binder.
What everyone think about this approach? Is doing the .ToString("C") in the mapping from domain to view model too much?