How can I pass parameters to a command in C#?

Learn how to pass data to a command without violating the command pattern in C#.

By Jeremy McPeak
February 21, 2017
Screen from "How can I pass parameters to a command in C#?" Screen from "How can I pass parameters to a command in C#?" (source: O'Reilly)

There are almost as many ways to implement the command pattern as there are types of data to pass to it, and not all of them are correct. Follow along in Visual Studio as Jeremy McPeak shows you how to enable an object to issue a request to another object while remaining blind to the details of both the request and target object. Jeremy then demonstrates how to pass required data to the command’s constructor. Users with a knowledge of C# fundamentals and basic patterns will gain the tools needed to pass data to a command without violating the command pattern.

Continue learning about C# with Learning Paths.

Learn faster. Dig deeper. See farther.

Join the O'Reilly online learning platform. Get a free trial today and find answers on the fly, or master something new and useful.

Learn more

Jeremy McPeak is a self-taught programmer who began his career tinkering with websites in 1998. He is the author of Beginning JavaScript, 5th Edition, JavaScript 24-Hour Trainer, and co-author of Professional Ajax, 2nd Edition. He also contributes to Tuts+ Code (http://code.tutsplus.com), providing articles, video tutorials, and courses on JavaScript, C#, ASP.NET, and PHP. He is currently employed by an oil and gas company, building in-house conventional and web applications.

Post topics: Software Engineering
Share: