Exemplo n.º 1
0
 public IEnumerable <City> GetCityByCountry(int id)
 {
     using (var ctx = new BabySitterContext())
     {
         return(ctx.City.Where(p => p.CountryId == id).ToList());
     }
 }
 public PersonalInformation GetByResume(Resume resume)
 {
     using (var ctx = new BabySitterContext())
     {
         return(ctx.PersonelInformation.SingleOrDefault(p => p.ResumeId == resume.Id));
     }
 }
Exemplo n.º 3
0
 public IEnumerable <Country> GetAll()
 {
     using (var ctx = new BabySitterContext())
     {
         return(ctx.Country.ToList());
     }
 }
        public void Delete(PersonalInformation personalInformation)
        {
            using (var ctx = new BabySitterContext())
            {
                ctx.PersonelInformation.Remove(personalInformation);

                ctx.SaveChanges();
            }
        }
        public void Delete(ContactInformation contactInformation)
        {
            using (var ctx = new BabySitterContext())
            {
                ctx.ContactInformation.Remove(contactInformation);

                ctx.SaveChanges();
            }
        }
        public void Update(PersonalInformation personalInformation)
        {
            using (var ctx = new BabySitterContext())
            {
                var entry = ctx.Entry(personalInformation);

                entry.State = System.Data.Entity.EntityState.Modified;

                ctx.SaveChanges();
            }
        }
        public PersonalInformation Add(PersonalInformation personalInformation)
        {
            using (var ctx = new BabySitterContext())
            {
                var entry = ctx.PersonelInformation.Add(personalInformation);

                ctx.SaveChanges();

                return(entry);
            }
        }
        public ContactInformation Add(ContactInformation contactInformation)
        {
            using (var ctx = new BabySitterContext())
            {
                var entry = ctx.ContactInformation.Add(contactInformation);

                ctx.SaveChanges();

                return(entry);
            }
        }