Пример #1
0
        public DVDResponse GetById(int id)
        {
            DVDResponse response = new DVDResponse();
            var         dvdById  = _dvdRepo.GetById(id);

            if (dvdById == null)
            {
                response.Success = false;
                response.Message = "There are no DVDs with this id.";
            }
            else
            {
                response.Success = true;
                response.DVD     = dvdById;
            }

            return(response);
        }
Пример #2
0
        public IHttpActionResult Get(int id)
        {
            IDVDRepo repo = Factory.Create();

            return(Ok(repo.GetById(id)));
        }