私は2つのコントローラーを持っています。
1つは
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(),
};
}
}
もう一つは
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");
}
}
}
Hireコントローラー->CheckData関数内で、CatalogController-> PrepareProductOverviewModels(...)を呼び出したいのですがどうすればよいですか?