public Task <bool> Handle(TakeFreightCommand request, CancellationToken cancellationToken)
        {
            var freightRegister = new FreightsRegister(request.FreightId, request.TruckerId, request.Payment, (int)FreightDeliveryStatus.Pending);

            _freightRegisterRepository.AddFreightRegister(freightRegister);
            _freightRegisterRepository.SaveChanges();
            return(Task.FromResult(true));
        }
Ejemplo n.º 2
0
 public void AddFreightRegister(FreightsRegister freightsRegister)
 {
     _truckerDbContext.Add(freightsRegister);
 }