One of the new features of Visual Studio 2008 for C # 3.0 automatic properties are, what's this about? very simple, remember when I define a class and implement its properties extremely common thing is to result in code like this
public class Customer
{string _name ; string
_direccion ;
public string nombre
{
get { return _nombre ; }
set { _nombre = value ; }
}
public string direccion
{
get { return _direccion ; }
set { _direccion = value ;}}
}
Ok, let's see how it would be our code using automatic properties syntax
public class Customer
{public string name {get ; September ;} public
string address { get ; September ;} public
int ID { get ; September ;}}
As we can see the new automatic property syntax, increases productivity of code. C # 3.0 compiler in a class when it detects a get and a set vacuum automatically creates a private variable and method to retrieve and assign the value of the property. In many instances the properties that define it are in my classes are of this type, that is why this syntax is very practical
Greetings!
0 comments:
Post a Comment