Hi Friends,
Am getting the error as below"
Error CS1503 Argument 1: cannot convert from 'System.Threading.Tasks.Task>' to 'System.Collections.Generic.List'
this.ViewLogs = new ObservableCollection(Task.Run(async () => await this.GetLogDetails()));
private async Task> GetLogDetails()
{
this.ViewLogs = new ObservableCollection();
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;
}
How to resolve this error?
Thanks in advance

gulam ansariPosted Aug 1, 2017, 4:05 AM
List objList = new List();
objList = (new ObservableCollection