asp.net mvc - How to create a generic controller action -
i have following controller action:
public actionresult saveedits(magheader viewmodel) { apprepository.savedata(viewmodel); return partialview("displayformodel", viewmodel); }
the viewmodel simple , holds few properties.
public class magheader { public string magdate { get; set; } public string magtitle { get; set; } }
this works fine. however, issue have 40 of these different viewmodels , controller action each. it's doing saving data properties of each can through reflection.
is there way have 1 controller handle of them? string properties key/value pairs. there way make controller action generic?
Comments
Post a Comment