//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; } }
//méthode create public void Create(EntityHarley Harley) { using (GarageContext context = new GarageContext()) { try { context.Harleys.Add(Harley); context.SaveChanges(); } catch { throw; } } }