Created
August 30, 2013 11:09
-
-
Save dgg/6388784 to your computer and use it in GitHub Desktop.
Model binding dynamic collections. IV DeleteController
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [HttpPost] | |
| public override ActionResult Index(string save, string discard, DeleteViewModel posted) | |
| { | |
| if (isSave(save, discard)) | |
| { | |
| _repository.Save(DeletableThing.ToThings(posted.Things)); | |
| } | |
| IEnumerable<Thing> updatedThings = _repository.Find(); | |
| var model = new DeleteViewModel | |
| { | |
| Things = DeletableThing.FromThings(updatedThings) | |
| }; | |
| return View(model); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment