Answers for "The type initializer for 'System.Linq.Dynamic.ExpressionParser' threw an exception."

0

The type initializer for 'System.Linq.Dynamic.ExpressionParser' threw an exception.

I'm also using Core 2.0 and was using System.Linq.Dynamic and got that error when I used an OrderBy extension, but I uninstalled it and installed System.Linq.Dynamic.Core instead, and now it's working perfectly


var data = (from app in _context.Applications select app);

//Sorting  
if (!(string.IsNullOrEmpty(sortColumn) && string.IsNullOrEmpty(sortColumnDir)))
{ 
    data = data.OrderBy(sortColumn + " " + sortColumnDir);
}
Posted by: Guest on June-17-2021

Code answers related to "The type initializer for 'System.Linq.Dynamic.ExpressionParser' threw an exception."

Browse Popular Code Answers by Language