diff --git a/rules/use-var/rule.md b/rules/use-var/rule.md index 82a30bb8c3d..02552f2849e 100644 --- a/rules/use-var/rule.md +++ b/rules/use-var/rule.md @@ -7,7 +7,9 @@ authors: url: https://www.ssw.com.au/people/bryden-oliver created: 2021-12-13T17:44:06.489Z guid: edd8d397-3651-47c0-8737-fa38152558d1 + --- + ::: todo TODO: Byrden - needs a new home (category) and a complete rewrite Old content from Better LINQ on .ASPX pasted below @@ -17,7 +19,7 @@ Old content from Better LINQ on .ASPX pasted below Despite what it looks like, the var keyword is not a throwback to the dark ages where we did not have strongly typed variables. It is just a short hand to save developers from typing out the type of a variable. -``` +```csharp IQueryable results = from c in dbContext.Customers where c.CompanyName.StartsWith(companyNameTextbox.Text) @@ -25,10 +27,10 @@ IQueryable results = customersBindingSource.DataSource = results; ``` ::: bad -Figure: Bad - you should just use "var" instead of "IQueryable" +Figure: Bad example - You should just use "var" instead of "IQueryable" ::: -``` +```csharp var results = from c in dbContext.Customers where c.CompanyName.StartsWith(companyNameTextbox.Text) @@ -36,5 +38,5 @@ var results = customersBindingSource.DataSource = results; ``` ::: good -Figure: Good - using "var" to save few keystrokes -::: \ No newline at end of file +Figure: Good example - Using "var" to save few keystrokes +:::