Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [HttpPost]
- //[ValidateAntiForgeryToken]
- public ActionResult Edit(List<int> objects, int newCollectionID)
- {
- //if (objects == null || newCollectionID == null)
- //{
- // return new HttpStatusCodeResult(HttpStatusCode.NoContent);
- //}
- var thingsToEdit = db.Words.Where(w => w.OwnerName == User.Identity.Name).ToList().Where(w => oneOfThem(objects, w.ID));
- foreach (var w in thingsToEdit)
- {
- w.CollectionID = newCollectionID;
- }
- return new HttpStatusCodeResult(HttpStatusCode.OK);
- //return RedirectToAction("Index");
- }
- public bool oneOfThem(List<int> objects, int id)
- {
- foreach(var a in objects){
- if(a == id){
- return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement