This is a simple crud operation on student table which is authorized.
more about this in : https://github.com/haftado3/parsan_auth
execute git clone https://github.com/haftado3/parsan-student.git
to clone this library.
connection string is inside appsettings.json
. in case you dont have Sql Server Express you need to change Connection String.
in case you dont have dotnet-ef
install dotnet-ef global for dotnet cli
then
dotnet ef database update
make sure you have parsan_auth API running on background before this.
then :
dotnet run
this will run app on https://localhost:5050
which can be configured inside launchSettings.json
import post man json file included at https://raw.githubusercontent.com/haftado3/parsan-student/master/Parsan-Student.postman_collection.json you can see this file at root directory of this project.
send a get request to https://localhost:5050/api/auth already included in postman with name of Get Token
.
which will give you a Bearer Token .
add Bearer Auth Recieved From previous section to All Other Reqeuests inside Authorization -> Token
with Authorization -> Type
of Bearer Token
.
token will expire in 1 hour.