예제 #1
0
        static void Main(string[] args)
        {
            //var galen = new Person("Galen", "Casstevens");
            //var length = GetMiddleNameLength(galen);
            //Console.WriteLine(length);

            var bmw   = new SportsCar("BMW", "335i", 2013);
            var count = GetNumberOfFeatures(bmw);

            Console.WriteLine(count);
        }
예제 #2
0
 static int GetNumberOfFeatures(SportsCar car)
 {
     //return car.Features?.Count ?? 0;
     //return car.Features is { Count: var count } ? count : 0;
     return(car.Features.Count);
 }