简体   繁体   中英

Nested objects and Aspose.Words LINQ syntax

How I can use nested objects in Aspose.Words LINQ templates? Fe I want to write something like that in a template

<<[Person.Related.Car.Model]>>

Is that achivable in Aspose.Words LINQ templates?

Please check the following article: Working with DataRow and DataRowView Objects

In order to make this work, you need to change your template like this:

<<[Person.Related.First().Car.First().Model]>>

Or like this:

<<foreach [in Person.Related]>><<foreach [in Car]>><<[Model]>><</foreach>><</foreach>>

Also, you can implement regular .NET classes - Person, Related, Car - and use XML deserialization. Then, it would be possible for you to use the wanted syntax, if an instance of the Person class is passed to the engine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM