Someone could give me a hand, please, I'd like to know what I'm doing wrong for this giving this error when it returns.
I want to show in Grid
these fields:
SubCategoriaId, SubCategoriaNome, CategoriaId, CategoriaNome
I have a parameter string valor
to do a search and return these fields, if the value is blank, it brings me all of the bank's.
I created a Model, to have the results "typed":
public class ResultadoCategSubCategoriaGrid
{
public int SubCategoriaId { get; set; }
public string SubCategoriaNome { get; set; }
public int CategoriaId { get; set; }
public string CategoriaNome { get; set; }
}
And I also have the models of each one Category:
public class Categoria
{
public int CategoriaId { get; set; }
public string Nome { get; set; }
}
And Subcategory
public class SubCategoria
{
public int SubCategoriaId { get; set; }
public string Nome { get; set; }
public int CategoriaId { get; set; }
}