January 25, 2018 at 5:51 am
Hi,
I have created .NET Console Application (C#). My SQL Server database has 3 tables. I created ADO.NET Entity Data Models for those tables in my project by Entity Framework Database First guide. They work fine, but I need to create another model for my SQL Query which is following:
SELECT users.name, users.userid, COUNT(userlogs.userid)
FROM users
LEFT JOIN userlogs ON users.userid = userlogs.userid
GROUP BY users.name, users.userid
It is expected to get users names, userids and counts of logs in userlogs table. Then my mission is to loop through these and create string which I use to show "Top 5 most causes for logs".
How should I go about creating required DbSet and Model like the generated ones from tables?
I'm using Visual Studio 2017, SQL Server 2012, Entity Framework 6.4, .NET 4.6.x.
Thank you
Viewing post 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy