Variable declared but never used (CS0168)
هذا المحتوى غير متوفر بلغتك بعد.
Key dotnet.codequality.unused-variable · Severity warning · Category codequality
C# compiler warning CS0168. Flags a local variable - often a catch variable - that is declared and never used.
Incorrect
Section titled “Incorrect”try{ Save();}catch (DbUpdateException ex){ return Conflict();}Correct
Section titled “Correct”try{ Save();}catch (DbUpdateException){ return Conflict();}