You could use:
var total = dbo.PrecisionArchive.Where(p => p.AgencySourceId == 7)
.Where(p => p.EventType == "R" || p.EventType == "ONS")
.Select(p => p.SampleDateTime)
.Distinct()
.Count();
1
solved How to convert SQL query into LINQ?