Beispiel #1
0
        internal Lego Delete(int id)
        {
            Lego foundLego = GetById(id);

            if (_repo.Delete(id))
            {
                return(foundLego);
            }
            throw new Exception("Something bad happened...");
        }
Beispiel #2
0
        internal string Delete(int id)
        {
            var exists = _repo.GetById(id);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }
            _repo.Delete(id);
            return("Successfully Deleted");
        }