It gets even better you can also pass Enum
as get parameter
@Html.ActionLink("Email Quote", "UnitDetails", "Journey", new { product = product.ProductTitle, button = "email" }, new { @class = "btn btn--main btn--main-orange" })
that ends up following url: http://localhost:50766/UnitDetails?product=Your%20quote&button=email
Action method that accepts looks like this:
[SessionTimeout]
public ActionResult UnitDetails(QuoteViewModel viewModel)
QuoteViewModel and enum:
public class QuoteViewModel : IQuoteViewModel
{
public QuoteViewModelProducts Products { get; set; }
public bool HasDiscount { get; set; }
public string Product { get; set; }
public DetailButtonType Button { get; set; }
}
public enum DetailButtonType
{
Buy,
Callback,
Email
}
What I love most is even if you pass enum parameter and value as lowercase it maps correctly to Uppercase property and Value, which makes my grin profusely.
