public IActionResult Listing(string sellItem) { var productId = Int32.Parse(sellItem); HttpContext.Session.SetInt32("SellingProductId", productId); dm.ProductInfo domainModel = FindProductInfoHelper.SingleProductById(productId); var viewModel = new ConversionNewListing(); CreateNewListingViewModel listing = viewModel.MappingCreateListing(domainModel); return(View("~/Views/Store/Listing.cshtml", listing)); }
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)); }