EasyRepository.EFCore icon indicating copy to clipboard operation
EasyRepository.EFCore copied to clipboard

✨ [FEATURE] Would like to migrate to 'file scoped' namespaces

Open jeffward01 opened this issue 3 years ago • 2 comments

Summary

I would like to remove all namespace scoped brackets, in favor of file-scoped namespaces.

No code changes will be required, as currently each file only uses one namespace - so this is a perfect scenerio to change to file scoped namespaces

Advantage

  • Cleaner code.
  • Currently, every file only has 1 namespace as it is, so it makes sense to use 'file-scoped namespaces'
  • No need for more brackets as it makes clutter

Additional context

Additional Reading topics

  • https://dotnetcoretutorials.com/2021/09/20/file-scoped-namespaces-in-c-10/?series
  • https://www.meziantou.net/updating-your-project-to-use-file-scoped-namespaces.htm
  • https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces

jeffward01 avatar Sep 26 '22 18:09 jeffward01

Great suggestion. Extending this feature that comes with C# 10 within the project will provide a cleaner code base. Do you want to make this improvement? If you don't have time, I'll include this issue in the planning and make this improvement myself.

Thank you for suggestion @jeffward01

furkandeveloper avatar Sep 26 '22 19:09 furkandeveloper

Great! Personally I was against all of the changes Microsoft introduced in net6 and C# 10, but now I have grown to love the changes... except for top-level program.cs statements, those are vile 🙃


I will add File-scoped namespaces into my next pull-request along side the changes mentioned here https://github.com/furkandeveloper/EasyRepository.EFCore/issues/16

jeffward01 avatar Sep 26 '22 23:09 jeffward01