CC0022 should not be raised whenever there is a chance that the object lives longer than the method where it was created in.
It should not be raised when assigned to a field/property from another class.
public void Foo(){
var parent = new Parent();
var disposable = new DisposableObject();
parent.Child = disposable;
}
It should not be raised when passed to any method, in the same class or otherwise:
public void Foo(){
var disposable = new DisposableObject();
Bar(disposable);
}
Note: This is coming from a comment on the extension, on the extensions gallery started by user fdsprod.
CC0022should not be raised whenever there is a chance that the object lives longer than the method where it was created in.It should not be raised when assigned to a field/property from another class.
It should not be raised when passed to any method, in the same class or otherwise:
Note: This is coming from a comment on the extension, on the extensions gallery started by user
fdsprod.