public async Task Accept(string rentalId, double price) { var rental = await _eventRepository.GetByIdAsync(new RentalId(rentalId)); rental.Accept(price); await _eventRepository.SaveAsync(rental); }
public async Task DeleteShip(string id) { var ship = await _eventRepository.GetByIdAsync(new ShipId(id)); ship.Undocked(); await _eventRepository.SaveAsync(ship); }
public async Task <Invoice> GetLastInvoiceForCustomer(string customerId) { Customer customer = await _customerRepository.GetCustomerAsync(customerId); Invoice invoice = await _eventRepository.GetByIdAsync(customer.Invoices.Last()); return(invoice); }
public Task <Customer> GetCustomerAsync(string customerId) { return(_eventRepository.GetByIdAsync(new CustomerId(customerId))); }