using System;
using System.Linq;
//using MvpSample.CustomerDb; //inutile après avoir déplacé EF model vers DomainClasses
// don't forgett to copy and paste connection string found in MvpSample.CustomerDb config file
// into this app.config file
// cif error check also with server explorer if sql express server is started
// if not open services manager from server explorer with right clic 
// can also be opened with Start Menu, type services.msc

using MvpSample.DomainClasses;
using MvpSample.DAL;


namespace RepoTest
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var repoCompany = new CompanyRepository())
            {
                var company = new Company { Name = "IUT GEII" };
                repoCompany.Add(company);
                repoCompany.Save();
                var companies = repoCompany.GetAll();
                foreach (var comp in companies)
                {
                    Console.WriteLine(comp.Id + " " + comp.Name);
                }

            }
            Console.ReadKey();
        }
    }
}
