0

I have a simple database table that is defined as such:

Column Name Data Type
AdministrativeAlertID int
AdministrativeEventID int
UserID int
Notes varchar
DateEntered datetime
AcknowledgedByUser int
AcknowledgedDate datetime
ERIMNotes varchar

I have a SQL query to grab certain event types and group by the type and user while also selecting the MAX AlertID.

SELECT MAX(aa.AdministrativeAlertID) AdministrativeAlertID, aa.UserID, aa.AdministrativeEventID
FROM dbo.OSAMS_AdministrativeAlerts aa
WHERE aa.AdministrativeEventID IN (4,8,9,10)
GROUP BY aa.UserID, aa.AdministrativeEventID
ORDER BY aa.UserID

I've been struggling to get this working as an Entity Framework statement.

Does anyone have a suggestion on how to wrangle this beast ?

  • Perhaps my [SQL to LINQ Recipe](https://stackoverflow.com/questions/49245160/sql-to-linq-with-multiple-join-count-and-left-join/49245786#49245786) might help you. – NetMage Sep 30 '21 at 23:09

0 Answers0