[Solved] Iterating through a generic list property

Use var here, the compiler than will decide in the foreach loop from which type the SearchItem in the list is. In this example var is of type string/ SearchViewModel<string> vs = new SearchViewModel<string>(new List<string> { “1”,”2″,”3″}); foreach (var item in vs.SearchItems) { // logic, item in this case is string } solved Iterating through … Read more

[Solved] Cannot implicitly convert type ‘System.Collections.Generic.IEnumerable’ to ‘System.Collections.Generic.List’ [closed]

Entity Framework has some async methods. You should use ToListAsync() but your method has to return the complete object. When you receive the object returned by the method, then you can use the Select method to get what you want. public async Task<IEnumerable<Intermediary>> GetTest(string company) { var db = new SibaCiidDbContext(); var results = (from … Read more