// Automatic property syntax.
public string PetName { get; set; }
}
■
Note
The Visual Studio 2008 “Prop” code snippet has been rewritten to make use of automatic property syntax,
rather than the traditional C# property logic (see Chapter 2 for an explanation of code snippets).
At first glance, automatic property syntax might seem as if you were defining an abstract prop-
erty to be overridden by derived types, given the presence of unimplemented get and set scopes.
However, this is not the case. If you did intend to define an abstract property in the Car type, you
would need to make use of the C# abstract keyword as follows:
abstract class Car
{
Do'stlaringiz bilan baham: |