Copied to clipboard

Flag this post as spam?

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


  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Jun 10, 2013 @ 16:11
    Rasmus Fjord
    0

    Fetching order from C# (tc 2)

    Hey :)

     

    Ive installed the starterkit and placed an order, when i try to fetch it it tells me "Value cannot be null" but not telling me which value : 

    any ideas ?

    using TeaCommerce.Api.Models;
    using TeaCommerce.Umbraco.Web;
    
            Guid g = new Guid("802E3B6A-200C-486A-8F66-84E96242EFD2");
            long l = 1;
            Order order = TC.GetOrder(l, g);
  • Anders Burla 2560 posts 8256 karma points
    Jun 11, 2013 @ 08:13
    Anders Burla
    0

    The code you have posted - where is that? In a console application or? Because maybe some of the config that Umbraco normally does - isnt done you you just run a console application.

    Kind regards
    Anders

  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Jun 11, 2013 @ 08:25
    Rasmus Fjord
    0

    Arh sry Anders :) 

    Its in a website application, where ive just inserted the umbracoDbDSN key in webconfig. 

    This was enough for TC 1 to work with the API. 

  • Anders Burla 2560 posts 8256 karma points
    Jun 11, 2013 @ 08:29
    Anders Burla
    100

    Well that is not enough anymore because 2.x is a but more flexible and smart that 1.x :)

    Here is what you need to do in some start up event of you website. We have it in the ApplicationBase (4.7+) of Umbraco is the Umbraco CMS system.
    http://our.umbraco.org/documentation/Reference/Events/application-startup

    The assembly files (.dll) also needs to be in your applications bin folder.

    try {
    DependencyContainer.Configure(
    Assembly.Load( "TeaCommerce.Api" ),
    Assembly.Load( "TeaCommerce.Api.Web" ),
    Assembly.Load( "TeaCommerce.Api.Persistence" ),
    Assembly.Load( "TeaCommerce.Umbraco.Configuration" )
    );
    } catch ( Exception exp ) {
    Log.Add( LogTypes.Error, 0, "Error loading Autofac modules Message: " + exp.Message + " - InnerException: " + exp.InnerException );
    }
  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Jun 11, 2013 @ 08:34
    Rasmus Fjord
    0

    And stuff works :) thx 

Please Sign in or register to post replies

Write your reply to:

Draft