refactor(backend): use explicit types instead of var by default
This commit is contained in:
parent
bc7fd6d804
commit
649988db25
52 changed files with 506 additions and 420 deletions
5
STYLE.md
5
STYLE.md
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue