0
Could someone give me a hand, please, I’d like to know what I’m doing wrong so this giving this error at the time of return.
I want to show on Grid
these fields:
SubCategoriaId, SubCategoriaNome, CategoriaId, CategoriaNome
I have a parameter string valor
to do a search and return me these fields, if the value is blank, it brings me everyone from the bank.
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 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; }
}
Possible duplicate of How to show data from 2 tables in a grid?
– Marco Souza