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)); }
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)); }
public AddNewKmStandAction(KmStand kmStand) { NewKmStand = kmStand; }