public OrderController(IAddOrderService addOrder, IConsultOrderService consultOrder, IUpdateOrderService updateOrder, IUpdateItemService updateItem) { _addOrder = addOrder; _consultOrder = consultOrder; _updateOrder = updateOrder; _updateItem = updateItem; }
public OrderController( IOrderService orderService, IUpdateOrderService updateOrderService, IMapper mapper, ILogger <OrderController> logger ) { OrderService = orderService; UpdateOrderService = updateOrderService; Mapper = mapper; Logger = logger; }
protected override void OnStop() { try { eventLog.WriteEntry("Stopping UpdateOrderStatus Service"); _updateOrderService = null; _updateOrderCancellation.Cancel(); _updateOrderTask.Wait(); eventLog.WriteEntry("Stopped UpdateOrderStatus Service"); } catch (Exception ex) { eventLog.WriteEntry(ex.Message + " -ST- " + ex.StackTrace, EventLogEntryType.Error); } }
protected override void OnStart(string[] args) { try { eventLog.WriteEntry("Starting UpdateOrderStatus Service"); InitializeSettingsService.InitializeConstants(); _updateOrderService = new UpdateOrderService(eventLog); _updateOrderCancellation = new CancellationTokenSource(); _updateOrderTask = Task.Run(() => DoUpdateOrderTask(_updateOrderCancellation.Token)); eventLog.WriteEntry("Started UpdateOrderStatus Service"); } catch (Exception ex) { eventLog.WriteEntry(ex.Message + " -ST- " + ex.StackTrace, EventLogEntryType.Error); } }