I have a class that has another class inside, but this class has some fields that i don´t want to show when call this controller. So, how can i hide ?
I tried to Include and do a Select with a new Class DTO, but not success. For example:
public class Father
{
public string name {get;set}
public FamilyName familyName {get;set;}
}
public class FamilyName
{
public string name {get;set}
public string sex {get;set}
}
Controller
public IQueryable<Father> GetFathers()
{
return db.Fater;
}
When i call the context Father, i have a Json with name and sex. If i need to just show the field "name", how should I do ?