# Force the existence of TROComplexType class attribute in codefirst servers definition

**URL:** https://talk.remobjects.com/t/force-the-existence-of-trocomplextype-class-attribute-in-codefirst-servers-definition/24707
**Category:** Remoting SDK
**Tags:** delphi, codefirst
**Created:** [May 6, 2021, 3:55pm UTC](https://talk.remobjects.com/t/force-the-existence-of-trocomplextype-class-attribute-in-codefirst-servers-definition/24707 "2021-05-06T15:55:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![techprogeticait](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/t/c89c15/32.png) [@techprogeticait](https://talk.remobjects.com/u/techprogeticait)
#### Post date: [May 6, 2021, 3:55pm UTC](https://talk.remobjects.com/t/force-the-existence-of-trocomplextype-class-attribute-in-codefirst-servers-definition/24707/1 "2021-05-06T15:55:42Z")

</div>

Hi,  
according to  
[Defining Code-First services (Delphi) (remotingsdk.com)](https://docs.remotingsdk.com/Servers/Concepts/CodeFirst/DefiningCodeFirstServicesDelphi/)

A class is considered as a Code-First Structure definition if these conditions are met:

- The class is inherited from the **TROComplexType** class directly or indirectly
- The class or any of its ancestor classes is used as data type of a parameter in a service or event interface method, or as a data type of a Structure or an Exception property

Does a code annotation exists to force any class **TROComplexType** descendant to be created in generated RODL to be used as property attribute of HttpApi Result?

Thank you

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [May 6, 2021, 4:01pm UTC](https://talk.remobjects.com/t/force-the-existence-of-trocomplextype-class-attribute-in-codefirst-servers-definition/24707/2 "2021-05-06T16:01:04Z")

</div>

Hi,

it depends on your service definition:

- if you specify `MyComplexType` as a result, it will check for all **used** `MyComplexType` descendants
- if you specify base `TROComplexType` as a result, it will check for all **used** `TROComplexType` descendants, including internal ones.

---

<div class="post-metadata">

### Author: ![techprogeticait](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/t/c89c15/32.png) [@techprogeticait](https://talk.remobjects.com/u/techprogeticait)
#### Post date: [May 6, 2021, 4:28pm UTC](https://talk.remobjects.com/t/force-the-existence-of-trocomplextype-class-attribute-in-codefirst-servers-definition/24707/3 "2021-05-06T16:28:47Z")

</div>

Thank you Evgeny,

even if my case is what you described, that property didn’t appear as result.

I’ve just found the nature of my problem: that property was a readonly property and, to correctly works, it has to be a read-write one.

Thank you very much

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [May 7, 2021, 8:53am UTC](https://talk.remobjects.com/t/force-the-existence-of-trocomplextype-class-attribute-in-codefirst-servers-definition/24707/4 "2021-05-07T08:53:48Z")

</div>

Thanks.

I’ve added this line to docs:

> - only read/write properties are supported
