public static async Task AddKmStand(KmStand kmstand, Dispatcher <IAction> dispatch, HttpClient http)
        {
            KmStandPost data = new KmStandPost()
            {
                stand = kmstand.stand, datum = kmstand.datum
            };

            await http.SendJsonAsync(HttpMethod.Post, "http://localhost:6001/api/v1/KmStanden", kmstand);

            dispatch(new AddNewKmStandAction(kmstand));
        }
Ejemplo n.º 2
0
        public async Task When(AddNewKmStand command)
        {
            _logger.LogInformation($"received command: {command.GetType().Name}");
            var repository = _repositoryFactory();

            KmStand kmStand = aggregateFactory.Create <KmStand>();

            kmStand.Create(command.Stand, command.Datum, command.AdresId);

            await Task.Run(() => repository.Add(kmStand));
        }
Ejemplo n.º 3
0
 public AddNewKmStandAction(KmStand kmStand)
 {
     NewKmStand = kmStand;
 }