Exemple #1
0
        // GET api/<controller>
        public IEnumerable <Family> Get()
        {
            List <Family> allFamilies;

            using (SqlUnitOfWork unitOfWork = new SqlUnitOfWork("gp"))
            {
                FamilyRepository familyRepo = new FamilyRepository(unitOfWork);
                allFamilies = familyRepo.GetAll();

                unitOfWork.Commit();
            }

            return(allFamilies);
        }