I have this method in my controller :
public async Task<ActionResult> GetDetails(Query query)
{
var son = await Task.Run(() =>
{
if(query.Export)
{
return RedirectToAction("GetDetails", "GridToolController");
}
if (!query.Export)
{
db.Configuration.AutoDetectChangesEnabled = false;
}
}
}
As you can see, I want to go to another controller, but when I write return, It gives these errors :
Anonymous function converted to a void returning delegate cannot return a value
Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type
Can you tell me how I can go to another controller from this controller? Thanks.