コード例 #1
0
        public bool Delete(int id)
        {
            var existing = db.Classes.FirstOrDefault(c => c.Id == id);

            if (existing == null)
            {
                return(false);
            }
            db.Remove(existing);
            db.SaveChanges();
            return(true);
        }