Beispiel #1
0
        public Artist GetById(int id)
        {
            try
            {
                var artbs = new ArtistBusiness();
                return(artbs.GetbyID(id));
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }
Beispiel #2
0
        public void Remove(int id)
        {
            try
            {
                var artbs  = new ArtistBusiness();
                var artist = artbs.GetbyID(id);
                artbs.Borrar(artist);
            }
            catch (Exception ex)
            {
                var httpError = new HttpResponseMessage()
                {
                    StatusCode   = (HttpStatusCode)422,
                    ReasonPhrase = ex.Message
                };

                throw new HttpResponseException(httpError);
            }
        }