IFeatures Collection has been disposed, object Name : Collection
Hi Dear All,
i have created a web api project and created a new web api named login, now i created asp.net core web application and make a login view and i am access web api method with HttpClient class, everything is ok but when i try to call
RedirectToAction() Method, it give me error "IFeatures Collection has been disposed, object Name : Collection" but when i comment all web api call code then this exception is not generated
Sample Code
[AllowAnonymous]
[HttpPost]
public async void VerifyUser(UsersEL objUser)
{
UsersEL oelUserResult = null;
string JsonParam = JsonConvert.SerializeObject(objUser);
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
//var content = new StringContent(JsonConvert.SerializeObject(objUser), Encoding.UTF8, "application/json");
//var response = await httpClient.GetAsync("https://localhost:44310/api/Login?Jsontest=" + JsonParam);
var response = await httpClient.GetAsync("https://localhost:44310/api/Login");
string apiResponse = await response.Content.ReadAsStringAsync();
//reservationList = JsonConvert.DeserializeObject<List<Reservation>>(apiResponse);
oelUserResult = JsonConvert.DeserializeObject<UsersEL>(apiResponse);
if (oelUserResult.IdProject.HasValue)
RedirectToAction("Index", "MainApp");
else
RedirectToAction("Index", "MainApp");
}
Waiting Reponse please
kindly help...