Я пытаюсь вернуть список людей с помощью WEB API, но у меня ничего не получилось. Я использую внедрение зависимостей (архитектура SOA)
<Error>
<Message> Error. </ Message>
<ExceptionMessage>
The type 'ObjectContent`1' could not serialize the response body for the content type application / xml; set of characters = utf-8 '.
</ ExceptionMessage>
<ExceptionType> System.InvalidOperationException </ ExceptionType>
<StackTrace />
<InnerException>
<Message> Error. </ Message>
, и мой метод следующий:
public class CuentaController : ApiController
{
private IUsurioESContrato _servicePerson;
public CuentaController()
{
_servicePerson = new UsuarioESImplementacion();
}
[HttpGet]
public IEnumerable GetListPersona()
{
PersonaModel model = new PersonaModel();
model.ListPersona = _servicePerson.ListarPersonas();
return model.ListPersona;
}