나는 두 개의 컨트롤러가 있습니다. > CheckData 기능, 나는 CatalogController 전화를 걸 - -MVC에서 다른 컨트롤러 기능을 호출하는 방법은 무엇입니까?
하나가 다른 하나
public class HireController : BaseNopController
{
[HttpPost]
public ActionResult CheckData(string submitButton)
{
switch (submitButton)
{
case "Yes":
// I want to call CatalogController --> PrepareProductOverviewModels
case "No":
return RedirectToRoute("detailform");
default:
return RedirectToRoute("detailform");
}
}
}
내부 컨트롤러를 대여입니다
public partial class CatalogController : BaseNopController
{
[NonAction]
protected IEnumerable<ProductOverviewModel> PrepareProductOverviewModels(IEnumerable<Product> products,
bool preparePriceModel = true, bool preparePictureModel = true,
int? productThumbPictureSize = null, bool prepareSpecificationAttributes = false,
bool forceRedirectionAfterAddingToCart = false)
{
var models = new List<ProductOverviewModel>();
foreach (var product in products)
{
var model = new ProductOverviewModel()
{
Id = product.Id,
Name = product.GetLocalized(x => x.Name),
ShortDescription = product.GetLocalized(x => x.ShortDescription),
FullDescription = product.GetLocalized(x => x.FullDescription),
SeName = product.GetSeName(),
};
}
}
입니다 을> PrepareProductOverviewModels (...)를 어떻게 할 수 해??