What is the best way between those two implementations of using statement: I wonder if the 2nd code prevent using from releasing the resource/ calling ondispose because of the return command?
1st code:
public byte[] DeriveSharedKey()
{
byte[] returnValue = null;
using (some resources)
{
some inner workings with resource...
returnValue = some_values;
}
return returnValue;
}
2nd code:
public byte[] DeriveSharedKey()
{
using (some resources)
{
some inner workings with resource...
return some_value;
}
}