S
shapper
Hello,
I am defining a property and check its value:
String _Name;
public String Name {
get { return _Name; }
set {
if (ValidationHelper.IsNotEmpty(_Name))
if (ValidationHelper.IsValidLenght(_Name, 0, 200))
_Name = value;
else
_errors.Add("Name", "The length shouldn't exceed 200
characters");
else
_errors.Add("Name", "The name is required");
}
}
On my code I am using:
MyInstance.Name = "Test".
The error "The name is required" is always fired and when I debugged
it the _Name is null.
What am I missing?
Thanks,
Miguel
I am defining a property and check its value:
String _Name;
public String Name {
get { return _Name; }
set {
if (ValidationHelper.IsNotEmpty(_Name))
if (ValidationHelper.IsValidLenght(_Name, 0, 200))
_Name = value;
else
_errors.Add("Name", "The length shouldn't exceed 200
characters");
else
_errors.Add("Name", "The name is required");
}
}
On my code I am using:
MyInstance.Name = "Test".
The error "The name is required" is always fired and when I debugged
it the _Name is null.
What am I missing?
Thanks,
Miguel