How to get URL link on X (Twitter) App
Suppose we have three middleware in our app then for each middleware we enter two times.
D - Dependency Inversion Principle (DIP)
2) DateTimeKind property and various operations like ToUniversalTime() and ToLocalTime() can lead to unexpected results
- If something is essential make it required
Properties vs Field
Following the DRY Principle can give us following benefits
Ternary Operator or Conditional Operator(?.) ย is used to evaluate a condition and then we can do something on that basis for true and false
HttpClient is a class in C# that is used for making HTTP calls of different kinds (most commonly Get/Put/Delete/Post).This class comes from namespace System.Net.Http
- Serilog and NLog for logging
๐๐ซ๐๐๐ค๐ข๐ง๐ : By default all queries are tracked , so behind the seen a change tracker keeps working on each entity. If you want to perform Update/Delete then you should use tracking.
While working with .NET application we sometime come up with exception and we can deal with it in two ways , either by using try catch block in each class (controller level or service level) or we can define a centralized and global point to catch the exception.
It is a technique for storing the responses of an API in a cache so that they can be served faster to sub sequent requests.
๐๐ญ๐๐ฉ ๐ : 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)
๐๐ง๐๐ฅ๐ฎ๐๐ ๐ง๐๐๐๐ฌ๐ฌ๐๐ซ๐ฒ ๐๐ง๐ญ๐ข๐ญ๐ข๐๐ฌ ๐๐ง๐ ๐๐จ๐ฅ๐ฎ๐ฆ๐ง๐ฌ : While retrieving data from multiple table make sure to include only necessary tables and columns Use eager loading only when it is necessary.
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.