예제 #1
0
        public override void Parse(XElement element)
        {
            Id = element.ElementAsLong("id");

            var bookElement = element.Element("book");

            if (bookElement != null)
            {
                Book = new BookSummaryResource();
                Book.Parse(bookElement);
            }

            Rating         = element.ElementAsInt("rating");
            Votes          = element.ElementAsInt("votes");
            IsSpoiler      = element.ElementAsBool("spoiler_flag");
            SpoilersState  = element.ElementAsString("spoilers_state");
            RecommendedFor = element.ElementAsString("recommended_for");
            RecommendedBy  = element.ElementAsString("recommended_by");
            DateStarted    = element.ElementAsDateTime("started_at");
            DateRead       = element.ElementAsDateTime("read_at");
            DateAdded      = element.ElementAsDateTime("date_added");
            DateUpdated    = element.ElementAsDateTime("date_updated");
            ReadCount      = element.ElementAsInt("read_count");
            Body           = element.ElementAsString("body");
            CommentsCount  = element.ElementAsInt("comments_count");
            Url            = element.ElementAsString("url");
            Owned          = element.ElementAsInt("owned");
        }
예제 #2
0
        public override void Parse(XElement element)
        {
            Id      = element.ElementAsLong("id");
            OwnerId = element.ElementAsLong("current_owner_id");
            OriginalPurchaseDate     = element.ElementAsDateTime("original_purchase_date");
            OriginalPurchaseLocation = element.ElementAsString("original_purchase_location");
            Condition = element.ElementAsString("condition");

            var review = element.Element("review");

            if (review != null)
            {
                Review = new ReviewResource();
                Review.Parse(review);
            }

            var book = element.Element("book");

            if (book != null)
            {
                Book = new BookSummaryResource();
                Book.Parse(book);
            }
        }