Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Object. #10

Open
mikila85 opened this issue Aug 19, 2015 · 3 comments
Open

Nested Object. #10

mikila85 opened this issue Aug 19, 2015 · 3 comments

Comments

@mikila85
Copy link

I have an object which is nested:

Record:
     String email;
     Person person;

Person:
     String FirstName;

the email gets generated but the FirstName inside the Person remains Null.

any help i can get with that please.

@mikila85
Copy link
Author

i just need to pass the object or the type as (where "OBJECT"):

Add(new Map()
                    .Matching(info =>
                    {
                        DataTypeAttribute hydratorType = info.GetCustomAttributes(typeof(DataTypeAttribute), false).Cast().FirstOrDefault();
                        return hydratorType != null && hydratorType.Kind == "Child";
                    })
                    .Using(new ChildGenerator(OBJECT)));

@PrintsCharming
Copy link
Owner

Does this work?

var hydrator = new Hydrator()
.With(x => x.Person, new TypeGenerator());
var _record = hydrator.GetSingle();

@geomorillo
Copy link

shouldn't this be made "automagically"? some classes have lots of children and grandchildren

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants