You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have patterns in code where API consult a parameter (which may be a test mock) and otherwise instantiate an instance of FileSystem() to perform work.
Rather than instantiating this class for each method call, we should have a singleton property (named Instance) that we use instead. The default file system capability is effectively a static helper class.
We have patterns in code where API consult a parameter (which may be a test mock) and otherwise instantiate an instance of FileSystem() to perform work.
Rather than instantiating this class for each method call, we should have a singleton property (named
Instance
) that we use instead. The default file system capability is effectively a static helper class.After this work, patterns like so:
fileSystem ??= new FileSystem();
will look like this:
fileSystem ??= FileSystem.Instance;
@eddynaka
The text was updated successfully, but these errors were encountered: