I have a table named CourseEpisode that have different property , one of them is TimeSpan
public TimeSpan time{ get; set; }
when i trying to get sum of Episod Time with this code :
var TotalTime = new TimeSpan(c.CourseEpisods.Sum(e => e.time.Ticks))
when i run my project i face with this Error :
InvalidOperationException: The LINQ expression '(EntityShaperExpression: EntityType: CourseEpisod ValueBufferExpression: (ProjectionBindingExpression: EmptyProjectionMember) IsNullable: False ).Time.Ticks' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(),ToList(), or ToListAsync()
please help me