TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gnanavel Sekar
NA
8.4k
7.3m
Cannot Convert from Tasks.Task to Generic.List
Jul 31 2017 9:39 AM
Hi Friends,
Am getting the error as below"
Error CS1503 Argument 1: cannot convert from 'System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Model.Patient>>' to 'System.Collections.Generic.List<Model.Patient>'
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;
}
How to resolve this error?
Thanks in advance
Reply
Answers (
1
)
Winform Application controls displays in top left
How to get particular character position from string usingC#