using Mvc_DTable.Models;
using System.Linq;
using System.Web.Mvc;

namespace Mvc_DTable.Controllers
{
    public class ClientesController : Controller
    {
        [HttpGet]
        public ActionResult Index()
        {
            return View();
        }

        [HttpGet]
        public ActionResult GetClientes()
        {
            using (ClientesDbContext _context = new ClientesDbContext())
            {
                var listaClientes = _context.Clientes.ToList();

                return Json(new { data = listaClientes }, JsonRequestBehavior.AllowGet);
            }
        }
    }
}