Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi (Matt), ;)
I've been digging around the demo store and noticed that you use code that doesn't exactly work on my machine so I'm wondering what I'm missing. I have a feeling it might be related to which modelbuilder is used?
On the home page you use: @Html.Action("FeaturedProducts", "ProductSurface") which returns the following error:
No route in the route table matches the supplied values.
You also seem to use the following on the search page where you use the namespace @using Vendr.DemoStore;
@Html.Partial("Pagination", Model.Cast<IPublishedContent, object>())
CS1061: 'PagedResult<IPublishedContent>' does not contain a definition for 'Cast' and no accessible extension method 'Cast' accepting a first argument of type 'PagedResult<IPublishedContent>' could be found (are you missing a using directive or an assembly reference?)
Since I don't use the Vendr.DemoStore I'm wondering if it's possible to see what's inside that namespace?
Hi Mike, the demo store is open source on Github,
I don't think this is a ModelsBuilder issue, I just think you have missed copying some bits over.
The first code snippet is attempting to render a child action, but given the error, it would appear you haven't copied over our ProductSurfaceController which is responsible for rendering the featured products
Regarding the second issue, again, it looks like you've not copied over the Cast extension method which you can find here
Hope this helps
PS As Tom said, the whole of the demo store is open source so you can review all the code for it at https://github.com/vendrhub/vendr-demo-store
You are right, I don't have those files in the Vendr.DemoStore folder.
If I download that entire folder, where should I place it?
I can see your DEMO project's .SLN file refers to the two folders:
Which mine doesn't. If I dowload the entire Vendr.DemoStore folder, how do I refer to it?
When using ModelsBuilder you should be aware of these settings in Web.config: https://github.com/vendrhub/vendr-demo-store/blob/main/src/Vendr.DemoStore.Web/Web.config#L50-L54
With these settings in demo store, ModelsBuilder generates the classes in this folder and use the namespace Vendr.DemoStore.Models:
With this approach also ensure that new generated models are included in the project and compiled in the assembly, when building the project/solution.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted