Skip to content
Eduardo Pignatelli edited this page Mar 19, 2019 · 7 revisions

Tour of C#

https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/

https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/classes-and-objects

https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/types-and-variables


Folders and namespaces

Namespaces and the folder structure that contains the .cs files have a close relationship. To define the correct folder structure helps keeping the relationship with the namespaces. This, in turn enables additional functionalities, such as deriving the web address of the source code of a method.

For a class, an Attribute, and Enum, an Interface, the folder structure respects the following rules:

A. If a file is in a sub folder, the namespace of the entity must follow: if Bar is in a sub folder Elements, its namespace must suffix the Elements word BH.oM.Structure.Elements.

B. An Enum must be in a separate folder Enums, but the namespace remains unchanged. For example BarFEAType is in the sub folder Elements, and it is an enum. Its namespace respects A., so it contains the Elementsword, but does not contain theEnumword: BH.oM.Structure.Elements. Although, since it is anEnumit is in anEnums` folder.

C. The same rule as B. applies to:

  • Attribute => Attributes
  • interface => Interfaces
Clone this wiki locally