コード例 #1
0
        public BusinessObject <EntityBase> FetchMetadataByID(int id)
        {
            ValidationUtility.ThrowIfLessThan(id, 1, "id");

            var entity = new TheTVDBDAO().GetShowByID(id);

            entity.Data.Updated = DateTime.Now;
            return(entity);
        }
コード例 #2
0
        public BusinessObject <EntityBase> GetByID(int id)
        {
            ValidationUtility.ThrowIfLessThan(id, 1, "id");

            // Example: http://api.themoviedb.org/3/movie/1858?api_key=c78b66672025d9b8a5fcb54a07c6ad84
            var entity = new BusinessObject <EntityBase>();
            var result = this.GetData("http://api.themoviedb.org/3/movie/{1}?api_key={0}", id.ToString());

            if (result.Errors.IsNullOrEmpty())
            {
                if (result.Data != null)
                {
                    entity.Data = this.MapToMovie(result.Data);
                }
            }
            else
            {
                entity.Errors.AddRange(result.Errors);
            }

            return(entity);
        }