using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebApplication1.Models;

namespace WebApplication1.Controllers {
  public class ExempleEditionMultipleController : Controller {
    private static List<Individu> MesGens = new List<Individu>() { new Individu { Prenom = "Gérard", Nom = "Mensoif" }, new Individu { Prenom = "Justine", Nom = "Titegout" }, new Individu { Prenom = "Alex", Nom = "Terrieur" } };
    public ActionResult Index() {
      lock ( MesGens ) {
        return View( MesGens.ToArray() );
      }
    }
    [HttpPost]
		
		public ActionResult Index( Individu[] edition ) {
      lock( MesGens ) {
        for( int i = 0, len = edition.Length; i < len; i++ ) {
          MesGens[i].Prenom = edition[i].Prenom;
          MesGens[i].Nom = edition[i].Nom;
        }
        return View( MesGens.ToArray() );
      }
    }
  }
}