HTTPS is a communication protocol which is widely used for over-the-internet communication. The protocol consists of multiple types and codes which enables the successful communication across the internet and also gives back the result whether the communication was successful or not.
HTTPS works great with Entity Framework Core and when used concurrently, can produce better results.
2. HYPE R TE XT T RANS FER
PROT OCOL (HT TP)
o Enables the communication between servers
and clients over the internet. The
communication takes place in the form of
requests and responses.
o It’s basically, a communication layer.
3. HTTP MET HODS
METHOD DESCRIPTION
GET Retrieves the data from the data source.
POST Inserts the data into the data source.
PUT Updates the existing resource from the data source based
on a key.
DELETE Deletes the existing resource from the data source based on
a key.
PATCH Partially alters or updates the resource from the database.
4. HTTP STA TUS CODE S
CODE RANGE DESCRIPTION
100 100 – 199 Informational Responses
101 – CONTINUE
200 200 – 299 Successful Responses
200 – OK, 201 – CREATED, 202 – NOT DOCUMENTED, 204 – NO
CONTENT
300 300 – 399 Redirection Responses
301 – MOVED PERMENANTLY, 302 – NOT FOUND, 304 – NOT MODIFIED
400 400 – 499 Client Error Responses
400 – BAD REQUEST, 401 – UNAUTHORIZED, 404 – NOT FOUND
500 500 – 599 Server Error Responses
500 – INTERNAL SERVER ERROR, 503 – SERVICE UNAVAILABLE
5. EF C ORE PACK AGES
o We must install these packages to use Entity Framework Core with our
SQL Server’s database.
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
6. EF C ORE COMM ANDS
o Add-Migration “Context”: Creates a migration file having the
logics to communicate between the server and database.
o Update-Database: After creating migration, we can enable that
migration to create or update the database accordingly.
o Scaffold-DbContext: Scaffolds the specific database into the
application, making Model classes according to the database tables
automatically.
7. IMPO RTAN T CL ASSE S/FI LES
o appsettings.json: A JSON file consisting of inherited features of
the application.
o Program.cs: Consists of all the dependencies based on which a
certain application functions.
o DBHelper: A database context class having the SQL Server Instance
connectivity property.
8. CONN ECTI ON S TRIN G
o A string which consists of all the connection information required for
making connection with the database.
It has the following syntax:
“SERVER=*YOUR_SERVER_NAME*;DATABASE=*DB_NAME*;Trusted_Connection=true;
TrustServerCertificate=true”