public void StringInterpolationSample()
 {
     var person = new PersonWithAutoPropInitializer();
     decimal personId = 40m;
     person.FirstName = "Joe";
     person.LastName = "Reynolds";
     Console.WriteLine($"New Person ID: {personId:d4}");
     Console.WriteLine($"New Name: {person.WrongValue} {person.LastName}");
 }
        public void StringInterpolationSample()
        {
            var     person   = new PersonWithAutoPropInitializer();
            decimal personId = 40m;

            person.FirstName = "Joe";
            person.LastName  = "Reynolds";
            Console.WriteLine($"New Person ID: {personId:d4}");
            Console.WriteLine($"New Name: {person.WrongValue} {person.LastName}");
        }
 public PersonWithAutoPropInitializer GetPersonWithAutoPropInitializer()
 {
     var person = new PersonWithAutoPropInitializer
     {
         FirstName = "Joe",
         LastName = "Reynolds"
     };
     if (person.PersonId == Guid.Empty)
         throw new ArgumentException($"{nameof(person.PersonId)} was empty");
     return person;
 }
        public void StringConcatSample()
        {
            var person = new PersonWithAutoPropInitializer();
            person.FirstName = "Joe";
            person.LastName = "Reynolds";

            var outputStr = "Person ID: " + person.PersonId;
            outputStr += Environment.NewLine;
            outputStr += "Name: " + person.FirstName + " " + person.LastName;

            Console.WriteLine(outputStr);
        }
        public PersonWithAutoPropInitializer GetPersonWithAutoPropInitializer()
        {
            var person = new PersonWithAutoPropInitializer
            {
                FirstName = "Joe",
                LastName  = "Reynolds"
            };

            if (person.PersonId == Guid.Empty)
            {
                throw new ArgumentException($"{nameof(person.PersonId)} was empty");
            }
            return(person);
        }
        public void StringFormatSample()
        {
            var person = new PersonWithAutoPropInitializer();

            person.FirstName = "Joe";
            person.LastName  = "Reynolds";

            var line1 = string.Format("Person ID: {0}", person.PersonId.ToString());
            var line2 = string.Format("Name: {0} {1}", person.FirstName, person.LastName);

            Console.WriteLine(line1);
            Console.WriteLine(line2);
            Console.WriteLine("Did it work?");
        }
        public void StringConcatSample()
        {
            var person = new PersonWithAutoPropInitializer();

            person.FirstName = "Joe";
            person.LastName  = "Reynolds";

            var outputStr = "Person ID: " + person.PersonId;

            outputStr += Environment.NewLine;
            outputStr += "Name: " + person.FirstName + " " + person.LastName;

            Console.WriteLine(outputStr);
        }
        public void StringFormatSample()
        {
            var person = new PersonWithAutoPropInitializer();

            person.FirstName = "Joe";
            person.LastName = "Reynolds";

            var line1 = string.Format("Person ID: {0}", person.PersonId.ToString());
            var line2 = string.Format("Name: {0} {1}", person.FirstName, person.LastName);

            Console.WriteLine(line1);
            Console.WriteLine(line2);
            Console.WriteLine("Did it work?");
        }