using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Web.Mvc;

using ExempleMvc.Models;
using WebApplication1.Common;

namespace ExempleMvc.Controllers
{
    public class HomeController : Controller
    {
        private Connexion               _Connexion;
        private DataSet                 _DataSet;
        private IEnumerable   _IUserList;

        public ActionResult Index()
        {


ViewBag.InitValueInController = "ValueInController";

_Connexion  = new Connexion();
_DataSet    = _Connexion.OuvertureBDD("SELECT * FROM dbo.Personnage");

_IUserList  = _DataSet.Tables[0].AsEnumerable().Select(row => new Personne {
    Id      = row.Field("Id"),
    Nom     = row.Field("Nom"),
    Prenom  = row.Field("Prenom"),
    Pics    = row.Field("Pics")
}).ToList();


            return View("Index", _IUserList);
        }
    }
}