vkhorikov / DddAndEFCore

Source code for the DDD and EF Core Pluralsight course
https://enterprisecraftsmanship.com/ps-ef-core
MIT License
249 stars 90 forks source link

Multiple classes in a single file #7

Closed SuperJMN closed 3 years ago

SuperJMN commented 3 years ago

There are many classes inside the same file. For instance: https://github.com/vkhorikov/DddAndEFCore/blob/80ca887f8cdf0e96ca5f2e12d451bcbc2562f606/src/App/IDomainEvent.cs

davidhenley commented 3 years ago

@SuperJMN why is this an issue? This is completely fine.

SuperJMN commented 3 years ago

@davidhenley It's quite confusing to find an EventDispatcher inside a file called IDomainEvent.cs :) I always try to follow the principle of least astonishment.

In my case, I was browsing the code using GitHub, looking for the dispatcher and had to use the Search feature instead. I wasn't even sure if it was inside the correct folder.

davidhenley commented 3 years ago

@SuperJMN Ah, you are correct. I didn't see the filename. Feel free to open a PR to fix!

vkhorikov commented 3 years ago

Yep, it's handy to create multiple classes in a single file while doing demo presentations to avoid context switching, but they then become harder to navigate.