Exemple #1
0
        public ActionResult DestroyStylist(int id)
        {
            var     numOfDeletions = _db.Database.ExecuteSqlCommand($"DELETE FROM clients WHERE StylistId={id}");
            Stylist thisStylist    = _db.Stylists.FirstOrDefault(stylist => stylist.StylistId == id);

            _db.Remove(thisStylist);
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }