refactor(backend): use explicit types instead of var by default

This commit is contained in:
sam 2024-12-08 15:07:25 +01:00
parent bc7fd6d804
commit 649988db25
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
52 changed files with 506 additions and 420 deletions

View file

@ -3,9 +3,8 @@
## C# code style
- Code should be formatted with `dotnet format` or Rider's built-in formatter.
- Variables should *always* be declared using `var`,
unless the correct type can't be inferred from the declaration (i.e. if the variable needs to be an `IEnumerable<T>`
instead of a `List<T>`, or if a variable is initialized as `null`).
- Variables should always be declared with their type name, unless the type is obvious from the declaration.
(For example, `var stream = new Stream()` or `var db = services.GetRequiredService<DatabaseContext>()`)
### Naming