mirror of
https://github.com/m-lamonaca/dev-notes.git
synced 2025-04-08 11:56:41 +00:00
feat(dotnet): dotnet 8 any type alias
This commit is contained in:
parent
06ee959188
commit
196d6e99db
1 changed files with 7 additions and 4 deletions
|
@ -40,23 +40,26 @@ to native code later.
|
||||||
| Event, Enum, Enum Value, | PascalCase |
|
| Event, Enum, Enum Value, | PascalCase |
|
||||||
| Variables, Parameters | camelCase |
|
| Variables, Parameters | camelCase |
|
||||||
|
|
||||||
### Namespaces & Imports
|
### Namespaces, Imports & Aliases
|
||||||
|
|
||||||
Hierarchic organization of programs an libraries.
|
Hierarchic organization of programs an libraries.
|
||||||
|
|
||||||
```cs
|
```cs
|
||||||
using System; // import the System Namespace
|
using System; // import the System Namespace
|
||||||
using Alias = Namespace; // set an alias for a specific namespace
|
|
||||||
using static System.Console; // statically import a class to use its static methods w/o qualification
|
using static System.Console; // statically import a class to use its static methods w/o qualification
|
||||||
|
|
||||||
|
// type aliases
|
||||||
|
using Alias = Namespace.SubNamespace.Type;
|
||||||
|
using LookupTable = Dictionary<string, string>;
|
||||||
|
using Points = (int, int, int)[];
|
||||||
|
|
||||||
// global using [C# 10], should be in dedicated file
|
// global using [C# 10], should be in dedicated file
|
||||||
global using <namespace>;
|
global using <namespace>;
|
||||||
|
|
||||||
namespace Namespace; // [C# 10]
|
namespace Namespace; // [C# 10]
|
||||||
//or
|
//or
|
||||||
namespace Namespace // namespace declaration
|
namespace Namespace
|
||||||
{
|
{
|
||||||
// class here
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue