Esempio n. 1
0
        //methode delete

        public void Delete(EntityHarley Harley)
        {
            using (GarageContext context = new GarageContext())
                try
                {
                    context.Harleys.Attach(Harley);
                    context.Harleys.Remove(Harley);
                    context.SaveChanges();
                }
                catch
                {
                    throw;
                }
        }
Esempio n. 2
0
 //méthode create
 public void Create(EntityHarley Harley)
 {
     using (GarageContext context = new GarageContext())
     {
         try
         {
             context.Harleys.Add(Harley);
             context.SaveChanges();
         }
         catch
         {
             throw;
         }
     }
 }