I am trying to name my array of objects, but it lists only the result of the array being created:
public class Listagem {
public List<Captura> captura { get; set; }
}
my class
public class Captura {
public int Codigo { get; set; }
public string FotoURL { get; set; }
}
my controller
public IactionResult(Listagem models) {
var resultJson = JsonConvert.SerializeObject(models.captura);
...
Current results:
[
{
"Cod":11111,
"photo":xxxx,
Expected outcome:
{
"captura":[
{
"Cod":11111,
"photo":xxxx,
models? Is it of typeListagemor something else? If of typeListagemdid you tryJsonConvert.SerializeObject(captura);?