OrderService is always NULL in production but not in Dev. environment

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Thanks man appriciate you helping me this far.

Also I may have found the solution to the original problem.

Need tot test yet so Ill let you know but It may be the dependencyregistrar.

Got this from UPS


/// <summary>
    /// Dependency registrar
    /// </summary>
    public class DependencyRegistrar : IDependencyRegistrar
    {
        /// <summary>
        /// Register services and interfaces
        /// </summary>
        /// <param name="builder">Container builder</param>
        /// <param name="typeFinder">Type finder</param>
        /// <param name="config">Config</param>
        public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config)
        {
            builder.RegisterType<ShipStationService>().As<IShipStationService>().InstancePerLifetimeScope();
        }

        /// <summary>
        /// Order of this dependency registrar implementation
        /// </summary>
        public int Order => 2;
    }
3 years ago
In case anyone finds this interesting,

The solution to my problem:

OrderResponse retrieveOrder = _mollieOrderClient.GetOrderAsync(id).GetAwaiter().GetResult();
3 years ago
Interesting: https://stackoverflow.com/questions/17284517/is-task-result-the-same-as-getawaiter-getresult

Probably want to wrap it in a try/catch or set a timeout in case the task fails.  

Hopefully async gets much easier in version 4.4
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.