Code inspection: Method is called from both CQRS contexts (show on usages)
This inspection reports statements that look like a body of the previous statement and can cause confusion when reading the code.
In the example below, wr.WriteLine("hello");
looks like a nested statement of using
. ReSharper suggests removing the indent and separating the statements with a new line to improve readability and avoid ambiguity.
public void Test()
{
using var wr = new StreamWriter("C:\\hi.txt");
wr.WriteLine("hello");
Console.WriteLine("hi");
}
public void Test()
{
using var wr = new StreamWriter("C:\\hi.txt");
wr.WriteLine("hello");
Console.WriteLine("hi");
}
Last modified: 08 November 2024