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 NumberOfArticlesFROM Category c LEFT JOIN ArticleCategory ac ON c.IdCategory = ac.IdCategoryGROUP BY c.IdCategory, Name, DisplayOrderORDER BY DisplayOrderI 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.