Monday, 19 August 2013

Controller for selecting enum values

Controller for selecting enum values

I need to select Coolants with Grape and Mango Only to be listed in a View
namespace Coolant.Models.Fruits {
public enum Category {
Apple = 0,
Mango = 1,
Pineapple = 2,
Grape = 3
}
}
This is the controller that I used to list only grapes . How should I
reformat inorder to list all the Grape and Mango coolants
# region Available
[HttpGet]
public ViewResult Availability(string cg) {
return View(new Coolant().List(Category.Grape));
}
# endregion

No comments:

Post a Comment