public void AddServiceOrder(Guid serviceOrderId, Person personOrdering, Person serviceman) { var serviceOrders = ServiceOrders.SingleOrDefault(x => x.Id == serviceOrderId); if (serviceOrders != null) { throw new Exception($"ServiceOrder with name: '{serviceOrderId}' already exists for device: {SerialNumber}."); } _serviceOrders.Add(new ServiceOrder(serviceOrderId, personOrdering, serviceman)); Updated = DateTime.UtcNow; }
public OrdersController() { serviceOrders = new ServiceOrders(); }
public OrdersController(IConfiguration configuration) { _configuration = configuration; _serviceOrders = new ServiceOrders(_configuration); }