The DateTime type stores time with much greater precision than seconds. They can differ at the level of a millisecond or even a tick (100 nanoseconds).
If you want to compare at a higher level, try the following:
(p.ActionDate.Ticks / 10000000) > (fromDate.Ticks / 10000000)
Where 10000000 is the number of ticks per second. Since / is the whole division that truncates the fraction, you rotate ticks for full seconds.
UPDATE:
It seems you are using the framework entity. The comparison above may not work there. The solution is to run the original database query, make a ToList and then filter the results again in the LINQ2Objects query using the above logic.
source share