Example #1
0
        public IActionResult GetListing()
        {
            List <dm.Listing> listings = ListingHelper.GetAllListingById((int)HttpContext.Session.GetInt32("UserId"));
            var model = new ConversionNewListing();
            List <CreateNewListingViewModel> viewModel = model.MappingViewListings(listings);

            foreach (var item in viewModel)
            {
                var productInfo = ListingHelper.GetProductIdByListingId(item.ListingId);
                item.ProductTitle = productInfo.ProductTitle;
                item.ImageUrl     = productInfo.ImageUrl;
            }

            return(View("~/Views/Partials/GetListings.cshtml", viewModel));
        }
Example #2
0
        public void Test_GetAllListinbByProductName()
        {
            var sut = ListingHelper.GetProductIdByListingId(listing2.ListingId);

            Assert.NotNull(sut);
        }