Beispiel #1
0
 public async Task SeedAsync()
 {
     if (!_seed)
     {
         return;
     }
     for (int i = 1; i <= 10; i++)
     {
         await _parcelService.CreateAsync(Guid.NewGuid(), $"Parcel #{i}",
                                          Guid.Empty, Guid.Empty, "Czarnowiejska 1");
     }
 }
Beispiel #2
0
 public async Task HandleAsync(CreateParcel command)
 {
     await parcelService.CreateAsync(command.Id, command.Name, command.SenderId,
                                     command.ReceiverId, command.ReceiverAddress);
 }
        public async Task <IActionResult> Post([FromBody] CreateParcel command)
        {
            await _parcelService.CreateAsync(command.Id, command.Name, command.SenderId, command.ReceiverId, command.ReceiverAddress);

            return(CreatedAtAction(nameof(Get), new { id = command.Id }, null));
        }