I have Angular application that is consuming .NET CORE 2.0 Web API, I need to ensure route define strongly type of class 'ResponseCurrentStateDataView' and receive JSON object as parameter from Angular application
Angular Class structure
export class ResponseCurrentStateDataModel
{
consultationId:string;
responseTypeId: string;
responseTypeTitle:string;
responsesRequestedStatus:string;
}
C# class structure
public class ResponseCurrentStateDataView
{
public Guid ConsultationId { get; set; }
public Guid ResponseTypeId { get; set; }
public string ResponseTypeTitle { get; set; }
public string ResponsesRequestedStatus { get; set; }
}
Web API (how to define route structure and parameter??? )
[Route("[action]/{responseCurrentStateObject}")] // i believe this is incorrect
[HttpGet]
public JsonResult GetResponsesByResponseStatusType(ResponseCurrentStateDataView responseCurrentStateObj) ??????
{
//my code.... responseList
return Json(responsesList);
}