public bool Delete(int id)
{
using (var db = new CustomerContext())
{
try
{
Products slett = (from p in db.Products where p.productID == id select p).Single();
db.Products.Remove(slett);
db.SaveChanges();
return true;
}
catch (Exception ex)
{
_logging.logToDatabase(ex);
}
}
return false;
}