Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
can anyone explain me this piece code?
Arvind Chourasiya
May 28 2016 9:02 AM
297
Reply
public class Cat : Entity
{
private string _name;
public string Name
{
get { return _name; }
set
{
if (value.Equals(_name))
{
return;
}
_name = value;
OnPropertyChanged();
}
}
}
Entity class:
public void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
So here,
1) ^^^
private string _name;
public string Name
{
get { return _name; }
set
{
if (value.Equals(_name))
{
return;
}
_name = value;
OnPropertyChanged();
}
}
2)^^^
public string Name{get;set}
so what is the difference between 1 and 2. can replace cat class all code 1^^^ with code 2^^^
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
IN Country and states drop dows ....states or not populating
Control Events not Opening in .CS page in ASP.net