This is not an answer, but i have too many doubts to post it as a comment.
1. I don't understand the reason of creating two classes containing almost the same data, where an
ADto
should be a base class for
A
. Take a deeper look at them:
public class A
{
public int Age{get;set;}
public string Name{get;set;}
public InnerA InnerAObj{get;set;}
} |
public class ADto
{
public int Age{get;set;}
public string Name{get;set;}
} |
For example: the base class of dog and snake is animal. They have few common properties, such as gender, family, eyes, etc. But they also differ: dog has got hair and snake has not; dog can walk, snake - crawl. Got it?
Please, read about
Inheritance - C# Programming Guide | Microsoft Docs[
^] and
Polymorphism - C# Programming Guide | Microsoft Docs[
^]
2. I do not see direct relationship between
Result
class and
A
or
ADto
... There's a
StreetName
field which belongs to
InnerA
. So, i have no idea how do you want to "connect" (map) them together.
3. Seems that
Result
class should contain a list of
A
class. If so, then you'll never need to create
TotalCount
field, as a list already have one.
When you resolve above issues and clarify all doubts, maybe you'll be able to create proper classes and relationships between them.