this.ViewLogs = new ObservableCollection<LogInfo>(Task.Run(async () => await this.GetLogDetails()));
private async Task<IEnumerable<LogInfo>> GetLogDetails()
{
this.ViewLogs = new ObservableCollection<LogInfo>();
var listofLogs = await this.dataManager.LoggerRepository.GetAllLogsAsync();
if (listofLogs != null && listofLogs.Count() > 0)
{
foreach (var logs in listofLogs)
{
this.ViewLogs.Add(new LogInfo
{
CreationDate = logs.CreationDate,
Id = logs.id,
Levels = logs.Levels,
Logger = logs.Logger,
Message = logs.Message,
ImageLevel = this.SelectImageLevels(logs.Levels),
});
}
}
return this.ViewLogs;
}