Forums - C# Corner

Forum guidelines
Rajendra Taradale

Rajendra Taradale

  • 1.2k
  • 581
  • 47.9k

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)