I'm testing your new domain model and I'm looking for documentation on the MetaProperty's property "Kind", could you explain to me when we could use the "custombehavior" and "calculated" values ? and how to use it ?
Thanks in advance.
13 Answers, 1 is accepted
While revising the implementation of this feature I we have found out there are some issues that need to be addressed, until they are you will not be able to use this facet. We will be releasing an internal build this week, however it is not likely the fix for this to be included in it.
This of course will be addressed in the following service pack. I am sorry for the inconvenience caused. For the time being please share some light on what you are trying to accomplish, there might be a solution not including this particular facet.
Looking forward to your reply.
Serge
the Telerik team
Thanks for your response, today I can't explain to you what I want to do with this facet because I dont know what this facet can do.
For me a metaproperty of kind calculated could be very interesting, does it means this property is not mapped to database ? I don't know, so could you explain to me the signification of this value, and the value custombehavior ?
No problem for me to wait the next release or service pack, but what I need today is explanation...
Thanks for your great support.
These two options will be fully utilized when we provide support for importing classes and methods you have written into the domain model.
The calculated option should specify that the column is somehow calculated by others in its get accessor. This property is not persisted to the database.
The custom behavior option can be used for a property that has both get and set accessors that must implement complex custom logic. Usually the get should calculate the value from other properties and set modifies one or more other properties.
These are not yet here, so I suggest sticking to defaults and using partials with other properties that do the hard work.
I do hope this helps.
Serge
the Telerik team
I've another thread opened called "how to extend a class", it means "how to use partial class", I don't find a simple example in your code library or documentation for this, have you ?
I am glad to see that this is what you need. However I cannot give an exact timeframe, this functionality should be available in the following service pack.
I will answer your partials issue in the other thread.
Serge
the Telerik team
Can also you give an example on how we would use each of these scenario?
Thanks.
If you are using computed columns on the sql server the corresponding data will be cached in L1 or L2 cache. Otherwise if the information is being calculated in the property get accessor it will not be cached because it is not fetched from the sql server.
Greetings,
Damyan Bogoev
the Telerik team
Are these actually ready for usage now? Can you provide some samples that make use of them?
Thanks.
As previously stated the Custom Behaviour as well as Calculated properties are currently not supported at all. If you were to specify them through the designer you will get the default behaviour for the selected property. The default is Persistent.
If you however have a column that is calculated on the server you can use PersistentReadOnly to make sure it is accessed correctly and not inserted.
I am sorry for any inconvenience that this has caused you.
Serge
the Telerik team
Has there been any more work on this? I have columns that are encrypted on the database, so I would like to unencrypt them before passing them through. I would just add it to the T4 code modules you have, but I can't put in custom attributes through your modeling framework. (Like marking a field as needing to be decrypted in the code)
If this (Kind) field is active, perhaps that will do what I need.
Any thoughts?
Thanks,
Mark
Our next release will feature great improvements to our code generation framework. We will make it much more extensible and you will be able to easily add what you need there.
Kind regards,Petar
the Telerik team
Any updates on this? I can't find any documentation that states the kind is working.
If not have you guys come up with an alternative?
Thanks
The Kind property (on the context of any Property of a DomainClass) specifies the type of access for the property. It could be:
- Default - a property that is transient and is not saved to the data store or tracked for changes.
- Persistent - a property that is saved to the data store and is tracked for changes.
- PersistentWriteOnly - a write-only property.
- PersistentReadOnly - a read-only property.
- CustomBehavior - a property that is not saved to the data store. Typically, the Get accessor calculates the value from other properties, and the Set accessor modifies other properties.
- Calculated - indicates that the property is backend calculated (computed).
*last two are not available under fluent mapping yet.
More details you could read in the following articles:
Property Window
Work with Computed Columns
Setting DataAccessKind with Fluent Mapping
The "Kind" property should work as expected. If you experience any issues or difficulties determining the proper value for a given case please share more details and we will be happy to help you.
Kaloyan Nikolov
Telerik