diff --git a/XmlSchemaClassGenerator.Tests/XmlSchemaClassGenerator.Tests.csproj b/XmlSchemaClassGenerator.Tests/XmlSchemaClassGenerator.Tests.csproj
index 35ae4149..69e43069 100644
--- a/XmlSchemaClassGenerator.Tests/XmlSchemaClassGenerator.Tests.csproj
+++ b/XmlSchemaClassGenerator.Tests/XmlSchemaClassGenerator.Tests.csproj
@@ -12,6 +12,7 @@
false
false
false
+ latest
diff --git a/XmlSchemaClassGenerator/TypeModel.cs b/XmlSchemaClassGenerator/TypeModel.cs
index 64d4638b..b340161a 100644
--- a/XmlSchemaClassGenerator/TypeModel.cs
+++ b/XmlSchemaClassGenerator/TypeModel.cs
@@ -914,10 +914,18 @@ public void AddMembersTo(CodeTypeDeclaration typeDeclaration, bool withDataBindi
{
var ifNotEquals = new CodeConditionStatement(
new CodeBinaryOperatorExpression(
- new CodeMethodInvokeExpression(valueExpression, "Equals", getValueOrDefaultExpression),
- CodeBinaryOperatorType.ValueEquality,
- new CodePrimitiveExpression(false)
- ),
+ new CodeBinaryOperatorExpression(
+ new CodeMethodInvokeExpression(valueExpression, "Equals", getValueOrDefaultExpression),
+ CodeBinaryOperatorType.ValueEquality,
+ new CodePrimitiveExpression(false)
+ ),
+ CodeBinaryOperatorType.BooleanOr,
+ new CodeBinaryOperatorExpression(
+ new CodeMethodInvokeExpression(specifiedExpression, "Equals", hasValueExpression),
+ CodeBinaryOperatorType.ValueEquality,
+ new CodePrimitiveExpression(false)
+ )
+ ),
setValueStatement,
setSpecifiedStatement,
new CodeExpressionStatement(new CodeMethodInvokeExpression(null, "OnPropertyChanged",
diff --git a/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj b/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj
index 49ed3b2c..2fd0d5b3 100644
--- a/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj
+++ b/XmlSchemaClassGenerator/XmlSchemaClassGenerator.csproj
@@ -18,6 +18,7 @@
git
git://github.com/mganss/XmlSchemaClassGenerator
XmlSchemaClassGenerator
+ latest