Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dotnet-Guidelines
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lukas Drabek
Dotnet-Guidelines
Commits
b13320b3
Commit
b13320b3
authored
9 months ago
by
Lukas Drabek
Browse files
Options
Downloads
Patches
Plain Diff
Add new file
parent
d06ab32c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cheatsheet.md
+74
-0
74 additions, 0 deletions
cheatsheet.md
with
74 additions
and
0 deletions
cheatsheet.md
0 → 100644
+
74
−
0
View file @
b13320b3
## Code Order
1.
constants
2.
private fields
3.
public properties
4.
constructors
5.
static methods
6.
instance methods
## Naming
```
csharp
interface
IEmployee
{
}
enum
ERole
{
Guest
,
Employee
,
Secretary
}
internal
class
Example
(
IDataRepository
repository
)
{
private
const
string
Path
=
"/app"
;
private
const
string
FailMessage
=
"Fail"
;
private
int
_requiredAge
=
18
;
public
int
Age
{
get
;
set
;}
public
bool
HasRequiredAge
=>
Age
>=
18
;
public
Example
(
IDataRepository
repository
,
IExternalService
externalService
)
:
this
(
repository
)
{
}
public
static
string
PathOfFile
(
string
fileName
)
=>
$"
{
Path
}
/
{
fileName
}
"
;
public
async
Task
<
string
>
PrintTestAsync
(
bool
extendedMessage
,
CancellationToken
ct
)
{
var
data
=
await
repository
.
GetDataAsync
(
ct
);
var
result
=
data
.
IsSuccess
switch
{
true
=>
data
.
Message
,
_
=>
FailMessage
};
return
extendedMessage
?
$"result has value:
{
result
}
"
:
result
;
}
}
```
## Git
branch prefixes:
```
feature/
fix/
refactor/
style/
docs/
chore/
```
commit message:
```
<what was changed> (short and to the point, it can appear in the changelog)
<>
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment