Is there a way to call your applications API controller from another class without using the API's url?
For example I have this method in a "personContoller"
public async Task<ActionResult> GetPersonRecord(string id)
{
Person person;
var link = "api/entity/Person/" + id + "?format=json";
string results = await OneIMAction(link);
person = JsonConvert.DeserializeObject<Person>(results);
string json = JsonConvert.SerializeObject(person, Formatting.Indented);
return Content(json, "application/json");
}
How can I access the JSON result from this method in another C# class within the same application without resorting to using a web request? Is that possible?