Dave Bell

Dave Bell

  • 1.5k
  • 108
  • 7.3k

How to use average function with EF

Apr 5 2023 1:05 AM

I have a Entity named "transactions" with {Id, RawDateTime, Score,SId}

I want to get a average of Score per day for records having SId. What as I doing wrong here?

_context.transactions.Where(b => b.SId == request.Id).GroupBy(a=>a.RawDateTime.Date).Include(b=>b.Average(v=>v.Score)).ToListAsync()


Answers (5)