@@ -31,19 +31,19 @@ public async Task<GetLogChartsOutput> GetCharts<T>(IRepository<T> repository) wh
3131 var day = now . AddDays ( 0 - ( dayOfWeek - i ) ) ;
3232 var weeHours = now . AddDays ( i - dayOfWeek ) . Date . AddHours ( 23 ) . AddMinutes ( 59 ) . AddSeconds ( 59 ) ;
3333 output . All [ i ] = await repository . CountAsync ( x => x . LongDate >= day . Date && x . LongDate <= weeHours ) ;
34- output . Error [ i ] = await CountAsync ( LogLevel . ERROR , repository , day , weeHours ) ;
35- output . Info [ i ] = await CountAsync ( LogLevel . INFO , repository , day , weeHours ) ;
36- output . Debug [ i ] = await CountAsync ( LogLevel . DEBUG , repository , day , weeHours ) ;
37- output . Fatal [ i ] = await CountAsync ( LogLevel . FATAL , repository , day , weeHours ) ;
38- output . Trace [ i ] = await CountAsync ( LogLevel . TRACE , repository , day , weeHours ) ;
39- output . Warn [ i ] = await CountAsync ( LogLevel . WARN , repository , day , weeHours ) ;
34+ output . Error [ i ] = await CountAsync ( LogLevelConst . Error , repository , day , weeHours ) ;
35+ output . Info [ i ] = await CountAsync ( LogLevelConst . Info , repository , day , weeHours ) ;
36+ output . Debug [ i ] = await CountAsync ( LogLevelConst . Debug , repository , day , weeHours ) ;
37+ output . Fatal [ i ] = await CountAsync ( LogLevelConst . Fatal , repository , day , weeHours ) ;
38+ output . Trace [ i ] = await CountAsync ( LogLevelConst . Trace , repository , day , weeHours ) ;
39+ output . Warn [ i ] = await CountAsync ( LogLevelConst . Warn , repository , day , weeHours ) ;
4040 }
4141 }
4242
4343 return output ;
4444 }
4545
46- private async Task < int > CountAsync < T > ( LogLevel level , IRepository < T > repository , DateTime day , DateTime weeHours ) where T : class , ILogModel
46+ private async Task < int > CountAsync < T > ( string level , IRepository < T > repository , DateTime day , DateTime weeHours ) where T : class , ILogModel
4747 {
4848 return await repository . CountAsync ( x => x . LongDate >= day . Date && x . LongDate <= weeHours && x . Level == level ) ;
4949 }
0 commit comments