Comments on: C# Design Patterns – Command https://code-maze.com/command/ Learn. Code. Succeed. Mon, 01 Sep 2025 11:30:32 +0000 hourly 1 https://wordpress.org/?v=6.7.5 By: MarinkoSpasojevic https://code-maze.com/command/#comment-6401 Wed, 24 Aug 2022 14:03:08 +0000 https://code-maze.com/?p=47758#comment-6401 In reply to Efim Zabarsky.

Hello Efim. You are most welcome. Now, I must be blind here, so could you please tell me where is the typo?

]]>
By: Efim Zabarsky https://code-maze.com/command/#comment-6400 Wed, 24 Aug 2022 13:16:40 +0000 https://code-maze.com/?p=47758#comment-6400 hi
thanks

typo: DecreasePrice(_amount);

]]>
By: Marinko Spasojević https://code-maze.com/command/#comment-5925 Wed, 22 Jun 2022 10:45:20 +0000 https://code-maze.com/?p=47758#comment-5925 In reply to Unknown.

Yeah, you are right.

]]>
By: Unknown https://code-maze.com/command/#comment-5924 Wed, 22 Jun 2022 08:48:42 +0000 https://code-maze.com/?p=47758#comment-5924 private static void Execute(Product product, ModifyPrice modifyPrice, ICommand roductCommand
{
modifyPrice.SetCommand(productCommand);
modifyPrice.Invoke();
}

We may remove product pass in parameter?

]]>
By: Marinko Spasojević https://code-maze.com/command/#comment-5677 Thu, 19 May 2022 13:36:48 +0000 https://code-maze.com/?p=47758#comment-5677 In reply to Mahmoud Nasr.

You are most welcome.

]]>
By: Mahmoud Nasr https://code-maze.com/command/#comment-5676 Thu, 19 May 2022 10:45:47 +0000 https://code-maze.com/?p=47758#comment-5676 Great & neat. thanks

]]>
By: Jonatan Machado https://code-maze.com/command/#comment-1637 Tue, 03 Dec 2019 11:40:43 +0000 https://code-maze.com/?p=47758#comment-1637 Great article!
As a suggestion, What do you think instead of creating IProductCommand you create two Command classes.
The IncreasePriceCommand and DecreasePriceCommand fit better to command idea as well you can remove IFs and enum PriceAction.
Does it make sense for you?

]]>
By: Marinko https://code-maze.com/command/#comment-1560 Fri, 25 Oct 2019 08:18:34 +0000 https://code-maze.com/?p=47758#comment-1560 In reply to Vijayant.

Thank you a lot. I hope you will enjoy other articles as well. All the best.

]]>
By: Vijayant https://code-maze.com/command/#comment-1559 Thu, 24 Oct 2019 21:58:10 +0000 https://code-maze.com/?p=47758#comment-1559 Very good example thank you very much

]]>
By: James https://code-maze.com/command/#comment-1489 Mon, 23 Sep 2019 17:14:07 +0000 https://code-maze.com/?p=47758#comment-1489 Nice explanation. Thanks! I’ve got this in my favorites and will reference over the coming months as I force myself to take a more clean / stable and scalable approach!

My brain did throw an unknown type error on “IProductCommand” just FYI. Also, you could make this a lot better by attaching a diagram which matches the class names etc. However, sometimes diagrams cause us to think about something incorrectly / get the wrong idea and it’s best to just dive straight into the example – which is why I’m here vs. just looking at other’s diagrams! 🙂

]]>