Rank: Advanced Member
Groups: Authorized User, Developers, Registered Joined: 4/17/2019(UTC) Posts: 80
|
I'm working on a site with some legacy code from AC Gold written in visual basic. Does anyone know how to convert code like this to work in AC9?
Dim dataSource As ProductDataSource = New ProductDataSource() Dim pCol As IList(Of Product) = dataSource.LoadForStore(AbleContext.Current.StoreId)
Any help would be appreciated.
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers, Registered Joined: 4/17/2019(UTC) Posts: 80
|
I think something like this may work:
Dim dataSource As CommerceBuilder.Products.IProductRepository = CommerceBuilder.Common.AbleContext.Container.Resolve(Of CommerceBuilder.Products.IProductRepository)() Dim pCol As IList(Of CommerceBuilder.Products.Product) = dataSource.LoadForStore(CommerceBuilder.Common.AbleContext.Current.StoreId)
|
|
|
|
Rank: Advanced Member
Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System Joined: 10/11/2018(UTC) Posts: 110
Thanks: 19 times Was thanked: 18 time(s) in 18 post(s)
|
First of all, add the following two using statements on the top Code:using CommerceBuilder.Products;
using CommerceBuilder.Common;
Then you can convert your legacy code like this: Code:var products = AbleContext.Container.Resolve<IProductRepository>().LoadForStore(AbleContext.Current.StoreId);
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close