Get and Set propriety

Jun 7 2013 10:43 AM
What is the problem with this when defining the properties

public
class UserLogonInfoGroup
{

public UserLogonInfoGroup()
{ }

public string DescriptionGroup { get; set; }

}
Some error: UserLogonInfo.DescriptionGroup.get' must declare a body because it is not marked abstract or extern

But when I encapsuled the proprerty it´s OK:

private string DescriptionGroup;
public string DescriptionGroup1
{
get { return DescriptionGroup; }
set { DescriptionGroup = value; }
}

What´s the diference please i need help about this.

hugs

Answers (1)