hi I've tried the code bellow
public Response SendContract(ContractRequest contractModel, string token)
{
Response data = null;
string baseAddress = "https://auth.services.centinsur.ir/api/Contract/Insert";
int Error = 0;
BLL.BLLResponse bLLResponse = new BLL.BLLResponse();
BLL.BLLRequest bLLRequest = new BLL.BLLRequest();
string ResponseText = "";
Response response = new Response();
using (HttpClient Client = new HttpClient())
{
try
{
Client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token);
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add("Id", contractModel.Id);
parameters.Add("IssueDate", contractModel.IssueDate);
parameters.Add("BeginDate", contractModel.BeginDate);
parameters.Add("EndDate", contractModel.EndDate);
parameters.Add("Count", contractModel.Count);
parameters.Add("Amount", contractModel.Amount);
parameters.Add("PersonCode", contractModel.PersonCode);
parameters.Add("Name", contractModel.Name);
parameters.Add("LastName", contractModel.LastName);
parameters.Add("NationalCode", contractModel.NationalCode);
parameters.Add("ContractId", contractModel.ContractId);
parameters.Add("ExternalNumber", contractModel.ExternalNumber);
var content = new FormUrlEncodedContent(parameters);
var response1 = Client.PostAsync(baseAddress, content).Result;
if (response1.IsSuccessStatusCode)
{
}
}
catch
{
}
}
return response;
}
but I think because of the number of records is high it is not the best practice ?