CreateAnonymous with IList or IEnumerable properties should try CreateMany<>().ToList()

Dec 12, 2011 at 2:28 PM

Hi there,

The scenario is the following.  I have a class A with the following 2 properties:

  • IList<B> Bs
  • IEnumerable<C> Cs

I think it would be a nice feature  if a call to CreateAnonymous<A> could try to automatically call CreateMany<X>.ToList() when an IList<X> or IEnumerable<X> property is encountered.

It would simplify the creation of object with complex hierarchy.  We would not have to explicitly configured each list or enumerable properties in this hierarchy.

What do you think?

Thanks

Phil

Coordinator
Dec 12, 2011 at 2:51 PM

Does this address your concern?

Dec 12, 2011 at 3:01 PM

Exactly our needs.

Thanks a lot.

The only thing missing would be a mention of this one in the Cheat sheet.

Again, thank you very much

Phil

 

Coordinator
Dec 12, 2011 at 3:03 PM

Agreed, the cheat sheet is a bit out of date...