Forums - C# Corner

Forum guidelines
Rajendra Taradale

Rajendra Taradale

  • 1.1k
  • 780
  • 105.5k

How can I use web API action method in another action method

Jan 12 2019 6:53 AM
For Example
 
Method1()
{
Return Ok(Some Complex Type)
}
Method2()
{
Some results = Method1()
}
 
By default OK(Object) return type is Microsoft.AspNetCore.Mvc.OkObjectResult
 
In some scenarios, I want to use the existing API method and I want that response in a readable format, so we need to convert Microsoft.AspNetCore.Mvc.OkObjectResult to custom type

Answers (2)