My code to display productlist in .net identity for asp.net 4.5 webforms is shown bellow. I try to use this code in .net 4.0 and can not correct error about [RouteData] !
public IQueryable<Product> GetProducts(
[QueryString("id")] int? categoryId,
[RouteData] string categoryName)
{
var _db = new WingtipToys.Models.ProductContext();
IQueryable<Product> query = _db.Products;
if (categoryId.HasValue && categoryId > 0)
{
query = query.Where(p => p.CategoryID == categoryId);
}
if (!String.IsNullOrEmpty(categoryName))
{
query = query.Where(p =>
String.Compare(p.Category.CategoryName,
categoryName) == 0);
}
return query;
}
In .net 4.0, I can not correct error with [QueryString("id")] and [RouteData] as argument! please help