1๏ธโฃ Plain Text Password
Saving password in plain text is the worst approach because it is open to everyone who has database access and an easy target for attackers. Its not recommended at all.
2๏ธโฃ Hashed Password
Hashing the plain text password first and then saving it, it seems safe but it isnโt safe again, you can fall for attack in this case as well rainbow attack.
3๏ธโฃ Hashed Password with Salt
Last option is hash of salt and plain password. This would be a suitable password.
โ๏ธ What is Salt
Salt is a unique and random string that we append with each password to make it safe. In C# we can simply use ๐๐๐๐ to get a unique string
โ๏ธHow hash password with salt is validated?
While saving password in database we store SALT as well
For login request we retrieve the SALT for the user and then combine it with the incoming password then hash it.
Compared it with hashed password saved in database and verify.
๐ง If you like it , you might be interested in my weekly .NET Newsletter , Join family of 550+ Software Engineers here lnkd.in/dNHxJGRG
โข โข โข
Missing some Tweet in this thread? You can try to
force a refresh
๐๐ญ๐๐ฉ ๐ : The LINQ Query is processed by EF Core and build an representation that is processed by database provider, and the result is cached later on so we don't need to process it every time #dotnet
See thread ๐งตโฌ
๐๐ญ๐๐ฉ ๐ : The result is passed to the db provider and db provider identifies which parts of query can be evaluated in db, these parts are then translated into query language (e.g. SQL) after that translated query is sent to db and db returns results (but not entity instances)
๐๐ญ๐๐ฉ ๐ : For each item we check if it is tracking query EF checks the data in existing change tracker if found relevant entity is returned else new is created, its change tracking get set up and it is returned
For non tracking a new entity is always created and returned.
๐๐ฌ๐ ๐จ๐ ๐๐ฌ๐๐จ๐๐ซ๐๐๐ค๐ข๐ง๐ : For read only queries e.g. (GetAll,GetById etc.) use AsNoTracking , when we use it entities are not tracked for change so it brings data more speedily. #dotnet
See thread ๐งต๐ฝ
๐๐ง๐๐ฅ๐ฎ๐๐ ๐ง๐๐๐๐ฌ๐ฌ๐๐ซ๐ฒ ๐๐ง๐ญ๐ข๐ญ๐ข๐๐ฌ ๐๐ง๐ ๐๐จ๐ฅ๐ฎ๐ฆ๐ง๐ฌ : While retrieving data from multiple table make sure to include only necessary tables and columns Use eager loading only when it is necessary. #dotnet
๐ ๐จ๐ซ ๐ฅ๐๐ซ๐ ๐ ๐๐๐ญ๐ ๐ฎ๐ฌ๐ ๐๐ค๐ข๐ฉ ๐๐ง๐ ๐๐๐ค๐ : Use skip and take to retrieve data from table for large collections because if we try to bring all data in single try it can take time that will give bad user experience takes next values. #dotnet
โ๏ธIf you like my tweets, please join 400+ Software Engineers to receive an actionable tip weekly in your inbox through my Newsletter.(lnkd.in/d69Va5CM)
โ Use an overload of theย String.Equalsย method to test whether two strings are equal
โ Use theย String.Compareย andย String.CompareToย methods to sort strings, not to check for equality.
โ Use overloads that explicitly specify the string comparison rules for string operations. Typically, this involves calling a method overload that has a parameter of typeย StringComparison.
GET is used to retrieve data, POST is used to save, PUT is used to update existing data edit is common example of it, PATCH is lighter version of PUT , it is used to update just a specific information instead of updating all data on server DELETE is used to remove records.
In CRUD operations
C stands for create : POST
R stands for read : GET
U stands for update : PUT/PATCH
D stands for delete : DELETE