public AvaTaxRateProvider(IContactService customerService, ILog log, params SettingEntry[] settings)
     : this()
 {
     Settings = settings;
     _logger = new AvalaraLogger(log);
     _customerSearchService = customerService;
 }
Пример #2
0
 public static void Write(this AvalaraLogger log, int eventCode, object context)
 {
     try
     {
         var type   = context.GetType();
         var method =
             log.GetType().GetMethods().FirstOrDefault(x => x.GetCustomAttributes(typeof(EventAttribute), true).Any() && ((EventAttribute)x.GetCustomAttributes(typeof(EventAttribute), true).First()).EventId == eventCode);
         if (method != null)
         {
             var parameters = new List <object>();
             method.GetParameters().ToList().ForEach(value => parameters.Add(type.GetProperty(value.Name).GetValue(context)));
             method.Invoke(log, parameters.ToArray());
         }
     }
     catch (Exception)
     {
         //try log error
     }
 }
Пример #3
0
 public AvaTaxController(ITaxSettings taxSettings, ILog log)
 {
     _taxSettings = taxSettings;
     _logger = new AvalaraLogger(log);
 }