无法从用法中推导出方法:请尝试显式指定类型实参???
asp.net MVC 2.0
public ActionResult Index(string sort, int? page)
{
var currentPage = page ?? 1;
ViewData["SortItem"] = sort;
sort = sort ?? "Name";
ViewData["CurrentPage"] = currentPage;
ViewData["TotalPages"] = (int)Math.Ceiling((float)_repository.CourseList.Count() / _pageSize);
var model = from c in _repository.CourseList
select new
{
课程号=c.课程号,
课程名=c.课程名,
创建日期=c.创建日期
};
var sortedmodel = model
.OrderBy(sort)
.Skip((currentPage - 1) * _pageSize)
.Take(_pageSize);
return View(sortedmodel);
}
错误 1 无法从用法中推导出方法“System.Linq.Enumerable.OrderBy<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,TKey>)”的类型实参。请尝试显式指定类型实参。 D:\JYF\BBDA\BBDA\Controllers\BrowseController.cs 41 17 BBDA
请问怎么办啊??????