2. About Me
16 years in the business
In .NET since 2005
Love to code
Technical Architect @ Steer73
3.
4. Никогда не мойте руки,
Шею, уши и лицо.
Это глупое занятье
Не приводит ни к чему.
Вновь испачкаются руки
Шея, уши и лицо.
Так зачем же тратить силы
Время попусту терять.
Стричься тоже бесполезно,
Никакого смысла нет.
К старости сама собою
Облысеет голова.
Вредные советы (Г. Остер)
7. Console
• Is dark and old (it’s 2k17, c’mon!)
• Long commands for simple tasks
• Yet another language to know
8. TL;DR;
• .NET developer should use only what is included in Visual Studio, or
has VS extenstion, or has nuget.
• Every developer on the project should use Visual Studio
• And JS guys
• And they should add their files to *.csproj
9.
10. First steps on new project
• Architecture
• Solution / project structure
• Layers
• Choosing of database / framework
11. Project structure
• Make many projects (e.g. at least 5 for datalayer)
• Create lot of folders and namespaces (services, services.core,
services.common, services.common.data)
• Always consider extracting a namespace into separate assembly
13. Data layer
• Only MS SQL (no NoSQL or Postgress)
• Only Entity Framework (no Dapper etc, we don’t want to use SQL in
2017)
• Use Repositories over DbContext (we need to abstract our persistence
layer)
• One Repository per entity
14. Regions
• Define sections for fields / methods / private / public
• Sections in large classes
• Sections in large methods
15. Inheritance
• Move commonly used methods into parent classes
• Make protected fields
• All ASP.NET controllers should have abstract parent!!!!
16. Code contracts
• Make your code even more enterprisy
• Combine with partial classes and TFS permissions
23. Always full names
var myAddress = addresses.Where(_ => _.Street == "...");
Address myAddress =
addresses.Where(address => address.Street == "...");
24. Working in Visual Studio
• Install packages via GUI, not package manage console
• Work with git via GUI as well – no console
• Try to avoid extensions