Skip to content

trongngo148/notes_dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Notes .NET Here's what I've learned while applying .NET.

✅ : High recommend

#1.The power of these types

Define an array:

Alt text

Define functions for performance testing:

Alt text

The result:

Alt text

✨ Explanation:

Array: We need to allocate memory, so it will take up more memory. ✅ Span: We are using pre-allocated memory. ✅ ArraySegment: This is not an array; it is a struct wrapper for an array and internally uses pointers and offsets to provide a sort of view.

#2. (DI) What is different between AddScoped, AddTransient and AddSingleton ?

First Request: Alt text

Second Request: Alt text

✨ Explanation:

Transient objects are always different; a new instance is provided to every controller and every service.

Scoped objects are the same within a request, but different across different requests

Singleton objects are the same for every object and every request (regardless of whether an instance is provided in ConfigureServices)

====================== Other parts coming soon...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published