Skip to main content

All Questions

39 votes
9 answers
50k views

Constructor parameter validation in C# - Best practices

What is the best practice for constructor parameter validation? Suppose a simple bit of C#: public class MyClass { public MyClass(string text) { if (String.IsNullOrEmpty(text)) ...
MPelletier's user avatar
  • 2,058