First you check your which properties are you passing from the api controller?
And You can try this type code in api controller:
[HttpGet]
[Route("GetEmployee")]
public HttpResponseMessage GetEmployee()
{
try
{
var employeeCollection = employeeService.GetEmployee().ToList();
if (employeeCollection.Count > 0 && employeeCollection != null)
{
dynamic employees = new List<ExpandoObject>();
foreach (var employeeDetail in employeeCollection)
{
dynamic employee = new ExpandoObject();
employee.ID = employeeDetail.ID;
employee.GroupCode = employeeDetail.GroupCode;
employee.AddAsMember = employeeDetail.AddAsMember;
employee.IsPrimaryGroup = employeeDetail.IsPrimaryGroup;
employee.AddAsGroupAdmin = employeeDetail.AddAsGroupAdmin;
employee.AddGroupRepTitle = employeeDetail.AddGroupRepTitle;
employees.Add(employee);
return this.Request.CreateResponse<List<ExpandoObject>>(HttpStatusCode.OK, (List<ExpandoObject>)employees);
}
}
else
{
return this.Request.CreateResponse(HttpStatusCode.NotFound);
}
}
catch (Exception ex)
{
Console.Write(ex.Message);
return this.Request.CreateResponse(HttpStatusCode.InternalServerError, new { Message = "Exception : " + ex.Message });
}
}
hope it's useful for you...