I am using nop commerce e-commerce open source 1.9 in which they use the Entity Framework.
They have one stored procedure which loads all the products and map that stored procedure to sp_ProductLoadAllPaged
function
Now I change that stored procedure and in out put of that sp their is one more column which is languages
.
I also declare the languages
property in product.cs class file.
But now as I use quick watch languages
column is null for all products.
I updated the .edmx
file from database in model browser.
Now I check that I am missing some mapping of languages attribute which in class and stored procedure
So please tell me how to map this new column of stored procedure to product class languages properties.
please see the below image for more information
As you can check the stored procedure final select statement where I made changes to get the languages of that product
SELECT
p.ProductId,
p.Name,
p.ShortDescription,
p.FullDescription,
p.AdminComment,
p.TemplateId,
p.ShowOnHomePage,
p.MetaKeywords,
p.MetaDescription,
p.MetaTitle,
p.SEName,
p.AllowCustomerReviews,
p.AllowCustomerRatings,
p.RatingSum,
p.TotalRatingVotes,
p.Published,
p.Deleted,
p.CreatedOn,
p.UpdatedOn,
p.AmazonLink,
p.ProductCode,
p.CategoryText,
STUFF((Select ','+ [Name] from Nop_Language where Nop_Language.LanguageId in
(Select Nop_ProductLocalized.LanguageID
from
Nop_ProductLocalized
where
ProductID=p.ProductId
) for xml path('')),1,1,'') as 'languages'
FROM
#PageIndex [pi]
INNER JOIN Nop_Product p with (NOLOCK) on p.ProductID = [pi].ProductID
WHERE
[pi].IndexID > @PageLowerBound AND
[pi].IndexID < @PageUpperBound
ORDER BY
IndexID