Example #1
0
 public Product Add(Product product)
 {
     product.Id = _nextId++;
     product.Description = "Integer congue orci enim, vitae sagittis odio gravida et. Ut volutpat quam et turpis gravida posuere. In accumsan efficitur diam.";
     product.LinkImage = _linkHost + product.LinkImage;
     product.CreatedAt = DateTime.Today;
     product.CreatedBy = "PhanThanhTuan";
     product.Availability = "In stock";
     _products.Add(product);
     return product;
 }
 private SyndicationItem BuildSyndicationItem(Product p)
 {
     var item = new SyndicationItem()
     {
         Title = new TextSyndicationContent(p.Name),
         LastUpdatedTime = p.CreatedAt,
         Content = new TextSyndicationContent(p.Description)
     };
     item.Authors.Add(new SyndicationPerson() { Name = p.CreatedBy });
     return item;
 }