namespace ConsoleApplication1 { using System; class Program { static void Main( string[] args ) { TestClass test = TestClass.CreateClass( ) ?? new TestClass( ); } public class TestClass { public bool IsValid { get; private set; } public TestClass( ) { } public static TestClass CreateClass( ) { if ( new Random( ).Next( 1 ) == 0 ) { TestClass result = new TestClass( ); result.IsValid = true; return result; } return null; } } } }
Theme based on MadsSimple dasBlog theme by Mads Kristensen
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.