Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chris Morley 11 posts 92 karma points
    Sep 23, 2015 @ 15:29
    Chris Morley
    0

    Run set stock outside of Umbraco context

    Hi we are using a console app to import data from a database to Umbraco to create product nodes. But am struggling to set the TeaCommerce stock level of products.

    When i try update a product like so:

    IProductService productService = ProductService.Instance;
    productService.SetStock(1, "658480", 10m);
    

    I get an exception {"Value cannot be null.\r\nParameter name: context"}

    with stacktrace

      at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
       at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable`1 parameters)
       at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters)
       at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context)
       at TeaCommerce.Api.Services.ProductService.get_Instance()
       at DataImporter.Program.Main(String[] args) in e:\Program.cs:line 55
    

    can anyone help? how am i supposed to set Tea commerce stock levels as part of a bulk import?

Please Sign in or register to post replies

Write your reply to:

Draft