Just upgraded to Vendr 2.1.0 from 2.0.4, walking up the upgrade path one at a time and read through the breaking changes, but wanted to confirm with you.
Yea, that's correct you need to pass a store. But you've just reminded me, I haven't yet updated Vendr Checkout (though I have updated the demo store).
public static IProductSnapshot AsVendrProduct(this IProductComp content)
{
var page = content as IPublishedContent;
if (page == null)
return null;
var store = page.GetStore();
return VendrApi.Instance.GetProduct(store.Id, content.GetProductReference(), Thread.CurrentThread.CurrentCulture.Name);
}
Ultimately, the front end generally knows what the store is, so it's now just the codes responsibility to tell the ProductAdapeter rather than it "magically knowing" which has caused issues for people creating complex custom product adapters.
In this Mr Matt a method is used GetHomePage() in this the Datatype is homePage please explain me what is homePage and it is giving error in my solution
I just checked all of the dependency versions for things like Vendr.Core.Models and nuget is reporting they are 2.1.0, however when browsing in code to IProductSnapshot it looks like it is still trying to reference an old dependency 2.0.4 exactly
Vendr 2.1.0 Breaking Changes Error
Matt,
Just upgraded to Vendr 2.1.0 from 2.0.4, walking up the upgrade path one at a time and read through the breaking changes, but wanted to confirm with you.
I have an extension method like such:
Which then i use like this:
With your breaking changes it is my understanding that I will now need to pass a store Id to my extension method inside
.AsVendrProduct()
correct?Perhaps I'm mis interpreting your changes. However my site breaks on the
priceRange
line with the following error:Thanks
Hi Kyle,
Yea, that's correct you need to pass a store. But you've just reminded me, I haven't yet updated Vendr Checkout (though I have updated the demo store).
This is what I changed it to in the Vendr Demo store https://github.com/vendrhub/vendr-demo-store/blob/v2/netcore/main/src/Vendr.DemoStore/Extensions/PublishedContentExtensions.cs#L40
Ultimately, the front end generally knows what the store is, so it's now just the codes responsibility to tell the ProductAdapeter rather than it "magically knowing" which has caused issues for people creating complex custom product adapters.
Matt
In this Mr Matt a method is used GetHomePage() in this the Datatype is homePage please explain me what is homePage and it is giving error in my solution
Interesting,
Ive implemented your code and understand it, hwoever i still return the error:
Am I missing another dependency that wasnt updated or something as it looks like the GetProduct is looking for 2 params not 3?
Ah or perhaps was that from the .Net Core branch? To be clear Im still running U8 under .NET 4.7.2
Sorry, yea, that was the .NET Core branch. I should have asked, but it was 50/50 😁
Matt
I just checked all of the dependency versions for things like Vendr.Core.Models and nuget is reporting they are 2.1.0, however when browsing in code to IProductSnapshot it looks like it is still trying to reference an old dependency 2.0.4 exactly
Actually, I fixed it and found a rogue old assembly in another project.
Now im battling Vendr Checkout reference issues
Glad you were able to fix this one 👍
is working on a reply...