C#C
C#4y ago
4 replies
Messiah

❔ MVC models conflicting names

I'm consuming a big api from azure, and the child model classes I'm building have conflicting names after I paste classes as JSON.

Example:
class Cats
{
public int size {get; set; }
public Skills skills {get; set;}
}
class Skills{ string blabla {get; set;}}

//other file
class Dogs
{
public int size {get; set;}
public Skills skills {get; set;}
}
class Skills{ string blabla {get; set;}}

I only need the root node to be public, but it doesn't seem like a good solution to make the child nodes private since i'll need to access them at some point.

Is there a way to make child nodes only accessible if I write out the root node name first?
Was this page helpful?