Skip to content

Instantly share code, notes, and snippets.

View ankittyagii's full-sized avatar
:octocat:
Hungry

Ankit Tyagi ankittyagii

:octocat:
Hungry
View GitHub Profile
@ankittyagii
ankittyagii / .Net Core WebApi
Last active April 28, 2022 19:24
.Net Coding Standard
S.No Description
1 ConfigureServices Method should be as lean as possible. Create an extension class with the static method. then just to call this extended method upon the IServiceCollection type
2 DAL should be created as a separate service. With DAL as a separate service we can register it inside the IOC (Inversion of Control) container.
3 The repository logic should always be based on interfaces
4 The controllers shouldn’t have any business logic inside it.
5 Actions should always be clean and simple. Actions should have IActionResult as a return type in most of the cases. That way we can use all the methods inside .NET Core which returns results and the status codes as well.
6 Handle errors globally as much as possible using built-in and ready to use middleware or custom middleware. Add that exception middleware in the Startup class by modifying the Configure method
7 Use ActionFilters to Remove Duplicated Code
8 Separate entities that communicate with the database from the entities that
1 . cd c:/program files/docker/docker
.\dockercli -Version
TO check the CLI vrsion
2. docker image ls - List out the images from docker host
3. docker container ls - list out the active container
4. docker system info
5. docker-compose --version
6. docker-machine --version
7. notary --version
8. docker container run -it ubuntu:latest /bin/bash