I want to create a customized search result rendering in order to achieve that I have to create a custom search result component. For creating custom search result component I have created a controller, model class and repository. while overriding the repository GetModel() method. I m getting an error no suitable method found to override. enter image description here

IRepository interface

enter image description here

Can anyone please suggest where I m going wrong? Thanks

  • Can you also share SearchResultCustomComponentModel so that it will me more clear to respond to you issue.
    – Akash S
    Feb 11 at 10:45

The GetModel() method is a virtual method of SXA AbstractRepository. Most of SXA repositories inherits from it, that is why we are overriding that method in a lot of places (as you probably noticed). What you need to do is to implement that method (as it comes from your interface) rather than override.

The same with FillBaseProperties() method. That is a virtual method of SXA base ModelRepository. The same, most of our repositories are using that base class so that we are overriding and using that method in GetModel().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.