✅ Dispose method to "dispose" file resource when using LogTo method
Hello guys, I'm trying to implement some simple logging in my DbContext. I want to write the logs in a file; when done, I need to dispose/close the file. I read that we can't use the
Here is what is written in the docs, but I have the warning CA1816. I didn't understand what exactly I need to do, I can just add this line:
using keyword because this would mean that our file stream will be closed and we won't be able to open it again (I thing, can someone please confirm please) and so we need to use the Dispose method.Here is what is written in the docs, but I have the warning CA1816. I didn't understand what exactly I need to do, I can just add this line:
GC.SuppressFinalize(this); ?