Exemplo n.º 1
0
        private async Task <bool> HandleShipUndocked(string message)
        {
            var receivedShip = JsonSerializer.Deserialize <ShipUndockedMessageEvent>(message);

            await _shipRepository.DeleteShip(receivedShip.ShipId);

            return(true);
        }
Exemplo n.º 2
0
        private async Task <bool> HandleShipUndocked(string message)
        {
            var receivedShip = JsonSerializer.Deserialize <ShipDockedEventModel>(message);

            Ship ship = new Ship()
            {
                Containers = receivedShip.Containers,
                Id         = receivedShip.ShipId
            };

            foreach (var container in ship.Containers)
            {
                await _containerRepository.DeleteContainerAsync(container.Id);
            }

            await _shipRepository.DeleteShip(ship.Id);

            return(true);
        }
Exemplo n.º 3
0
 public Task DeleteShipAsync(Guid shipId)
 {
     return(_shipRepository.DeleteShip(shipId));
 }