remove cast from dynamic to object for medium trust

This commit is contained in:
Erik Oppedijk
2013-08-31 15:15:10 +02:00
parent 26c45498df
commit ad35f7d900
18 changed files with 86 additions and 128 deletions

View File

@@ -66,13 +66,12 @@ namespace Orchard.Search.Controllers {
var pagerShape = Services.New.Pager(pager).TotalItemCount(searchHits.TotalItemCount);
dynamic viewModel = Services.New.ViewModel()
var viewModel = Services.New.ViewModel()
.ContentItems(list)
.Pager(pagerShape)
.SearchText(searchText);
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object)viewModel);
return View(viewModel);
}
}
}