Quantcast
Channel: Customized Commerce 13 and earlier versions
Viewing all articles
Browse latest Browse all 9642

Migrating partial classes of same controller to Optimizely 12

$
0
0

Hi,

In our current EpiServer ver. 11 we are having partial classes of startpage controller. Each partial class contains different action methods and some only returns JSON. 

After migrating to Optimizely 12 the index method is not get called as default  ->

https://localhost:5001 should call index method of startpage but its calling some other action method of the same controller which return Json

If i write https://localhost:5001/index then the index method is called 

Or said in other words, how can I make following code work -> 

public class StartPageController : PageControllerBase<StartPage>
{
    [HttpGet]
    public IActionResult GetDTO(string id)
    {
        return Json(new { id });
    }
    [HttpGet]
    public IActionResult Index(StartPage currentPage)
    {
        var model = PageViewModel.Create(currentPage);
        // Check if it is the StartPage or just a page of the StartPage type.
        if (SiteDefinition.Current.StartPage.CompareToIgnoreWorkID(currentPage.ContentLink))
        {
            // Connect the view models logotype property to the start page's to make it editable
            var editHints = ViewData.GetEditHints<PageViewModel<StartPage>, StartPage>();
            editHints.AddConnection(m => m.Layout.Logotype, p => p.SiteLogotype);
            editHints.AddConnection(m => m.Layout.ProductPages, p => p.ProductPageLinks);
            editHints.AddConnection(m => m.Layout.CompanyInformationPages, p => p.CompanyInformationPageLinks);
            editHints.AddConnection(m => m.Layout.NewsPages, p => p.NewsPageLinks);
            editHints.AddConnection(m => m.Layout.CustomerZonePages, p => p.CustomerZonePageLinks);
        }
        return View(model);
    }
}

Any help would be appreciated 


Viewing all articles
Browse latest Browse all 9642

Latest Images

Trending Articles



Latest Images