Most of all .NET serialization methods (including WCF) require the use of an accessible getter and setter, since it must be able to set the property to a value when it deserializes the input field.
, .
[DataContract]
class Foo
{
[DataMember(Name="IsDeleted")]
private bool _isDeleted;
public bool IsDeleted
{
get { return _isDeleted; }
internal set { _isDeleted = value; }
}
}
, Foo DLL refrence, , .
class Foo
{
public bool IsDeleted { get; set; }
}
, , , DLL Foo , WCF.
DLL, Silvermind, , .
[DataContract]
class Foo
{
private bool _isDeleted;
public bool IsDeleted
{
get { return _isDeleted; }
set { }
}
internal void SetIsDeletedInternal(bool value)
{
_isDeleted = value;
}
}
, , Foo, _isDeleted default(bool) , .