Joe
Member
- Joined
 - Jun 22, 2022
 
- Messages
 - 7
 
- Programming Experience
 - 3-5
 
Hi, I'm trying to do the following, but receiving this error:
'IQueryable<List<Account>>' does not contain a definition for 'ToList' and the best extension method overload 'Enumerable.ToList<Account>(IEnumerable<Account>)' requires a receiver of type 'IEnumerable<Account>'
Any pointers much appreciated.
	
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
	
		
			
		
		
	
				
			'IQueryable<List<Account>>' does not contain a definition for 'ToList' and the best extension method overload 'Enumerable.ToList<Account>(IEnumerable<Account>)' requires a receiver of type 'IEnumerable<Account>'
Any pointers much appreciated.
			
				Code:
			
		
		
		);
             int length = Convert.ToInt32(Request["length"]);
             string searchValue = Request["search[value]"];
             string sortColumnName = Request["columns[" + Request["order[0][column]"] + "][name]"];
             string sortDirection = Request["order[0][dir]"];
            List<Account> tAccounts = new List<Account>();
            var tAcc = from x in dbcontext.Accounts
                                select x.AsEnumerableOfOne()
                                .OrderBy(sortColumnName + " " + sortDirection)
                                .Skip(start)
                                .Take(length)
                                .ToList();
           tAccounts = tAcc.ToList<Account>();
	
			
				Last edited: