public IActionResult Detail([FromBody] EditScheduledDelivery command) { ScheduledDeliveryEditHandler.Execute(command, _postgresContext); ScheduledDeliveryConfirmHandler.Execute(command.DeliveryId, _postgresContext, _shopContext); return(RedirectToAction("List")); }
public static void Execute(EditScheduledDelivery command, PostgresContext postgresContext) { foreach (var scheduledDeliveryProduct in command.Products) { EditProduct(scheduledDeliveryProduct, postgresContext); } postgresContext.SaveChanges(); }