This question is locked. New answers and comments are not allowed.
Hi,
I use reverse model (database first). In designer I created dummy class called cSiteMenu. I created properties:
IdCategory (int32, identity)
CategoryName (string)
DisplayOrder (int32)
NumberOfArticles (int32)
I have SP:
I have this line in my code:
When I call it I get this error:
I use reverse model (database first). In designer I created dummy class called cSiteMenu. I created properties:
IdCategory (int32, identity)
CategoryName (string)
DisplayOrder (int32)
NumberOfArticles (int32)
I have SP:
SELECT c.IdCategory
, c.Name AS CategoryName
, DisplayOrder
, COUNT(ac.IdArticle) AS NumberOfArticles
FROM
Category c
LEFT JOIN ArticleCategory ac ON c.IdCategory = ac.IdCategory
GROUP BY c.IdCategory, Name, DisplayOrder
ORDER BY DisplayOrder
I have this line in my code:
var returnValue = db.ExecuteStoredProcedure<
cSiteMenu
>( "SiteMenu_Select", null, null ).ToList( );
When I call it I get this error:
Mapping the result to instances of the class 'EZine.BO.cSiteMenu' failed because the
required primary key column 'id_category' is not present.