using System;
using System.Linq;
using EF.ModelFirst.CustomerDb;
using EF.ModelFirst.DomainClasses;
using EF.ModelFirst.DAL;




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

            }
            Console.ReadKey();
           
        }
    }
}
