Example #1
0
        public OfferJson(Offer offer)
        {
            Id = offer.Id;

            offer.Owner.Password = null;
            Owner = new UserJson(offer.Owner);

            Price     = offer.Price;
            Accepted  = offer.Accepted;
            AuctionId = offer.Auction.Id;
        }
Example #2
0
        public AuctionJson(Auction auction)
        {
            Id          = auction.Id;
            Products    = auction.Products.Select(product => new ProductJson(product)).ToList();
            Description = auction.Description;

            Owner = new UserJson(auction.Owner)
            {
                Password = null
            };

            Offers       = auction.Offers.Select(offer => new OfferJson(offer)).ToList();
            CreationDate = auction.CreationDate;
        }