G
Guest
Hi,
I've got a property that returns byte[].
For example,
private byte[] bytes;
public byte[] ReturnsByteArray
{
get
{
return bytes;
}
set
{
bytes = value;
}
}
It compiled well, however, FxCop 1.32 is suggesting that..
"Properties should not return Arrays".
When I replaced the property with two methods, for example
public byte[] GetBytes()
{
return bytes;
}
public void SetBytes(byte[] by)
{
bytes = by;
}
Then, FxCop is suggesting this..
"Use properties where appropriate" pointing at "SetBytes(..)" method.
When I made my private byte[] bytes as public, then it is suggesting
not to expose variables, it suggests use of properties instead.
Kindly let me know how I can resolve this problem.
Cheers,
Naveen.
I've got a property that returns byte[].
For example,
private byte[] bytes;
public byte[] ReturnsByteArray
{
get
{
return bytes;
}
set
{
bytes = value;
}
}
It compiled well, however, FxCop 1.32 is suggesting that..
"Properties should not return Arrays".
When I replaced the property with two methods, for example
public byte[] GetBytes()
{
return bytes;
}
public void SetBytes(byte[] by)
{
bytes = by;
}
Then, FxCop is suggesting this..
"Use properties where appropriate" pointing at "SetBytes(..)" method.
When I made my private byte[] bytes as public, then it is suggesting
not to expose variables, it suggests use of properties instead.
Kindly let me know how I can resolve this problem.
Cheers,
Naveen.