code :To call other server api url from entity framework core api to read and write data for particular class
Loading
code :To call other server api url from entity framework core api to read and write data for particular class
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tuhin PaulPosted Mar 15, 2023, 1:27 AM
Hello Meghana M,
To call another server's API from your own API built with Entity Framework Core to read and write data for a particular class, you can use the HttpClient class provided by .NET Core. Here's an example of how you can use HttpClient to call an API:
To write data to the API, you can use the HttpClient's PostAsync or PutAsync methods to send data to the API.
You should always handle errors and exceptions that may occur when making API calls
Amit MohantyPosted Mar 14, 2023, 12:00 PM
You can use the HttpClient class provided by the .NET Core framework or you can use RestSharp.
Using HttpClient:
Using RestSharp: