This is a migrated thread and some comments may be shown as answers.

Property Kind of MetaProperty : CustomBehavior, Calculated

13 Answers 174 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
test
Top achievements
Rank 1
test asked on 31 Jul 2010, 08:12 PM
Hi,

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

Sort by
0
Serge
Telerik team
answered on 03 Aug 2010, 07:16 PM
Hello test,

 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.

Kind regards,
Serge
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
test
Top achievements
Rank 1
answered on 03 Aug 2010, 07:43 PM
Hi,

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.
0
Serge
Telerik team
answered on 04 Aug 2010, 04:30 PM
Hello test,

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.

Best wishes,
Serge
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
test
Top achievements
Rank 1
answered on 05 Aug 2010, 06:00 AM
Thanks for your answer, the beavior you describe are excatly what i was expecting.

Do you know when we could use this properties ?

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 ?
0
Accepted
Serge
Telerik team
answered on 06 Aug 2010, 03:01 PM
Hello test,

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.

Kind regards,
Serge
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Patrice Boissonneault
Top achievements
Rank 2
answered on 29 Mar 2011, 07:58 PM
It make sense that calculated fields are not persited to database, but can you tell us if they are going to be cached (L1 or L2) or recalculated at each access of the get property accessor?

Can also you give an example on how we would use each of these scenario?

Thanks.
0
Damyan Bogoev
Telerik team
answered on 30 Mar 2011, 07:46 PM
Hi Patrice Boissonneault,

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
0
Patrice Boissonneault
Top achievements
Rank 2
answered on 18 Apr 2011, 08:49 PM
I was more talking about Kind Calculated or Custom Behaviour.  Are those field value going to be cached in L2?

Are these actually ready for usage now?  Can you provide some samples that make use of them?

Thanks.
0
Serge
Telerik team
answered on 20 Apr 2011, 08:02 AM
Hi Patrice Boissonneault,

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.

Best wishes,
Serge
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Mark
Top achievements
Rank 1
answered on 13 May 2013, 11:44 PM
Hello,

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
0
PetarP
Telerik team
answered on 16 May 2013, 02:39 PM
Hello 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
OpenAccess Samples Kit boasts 50+ sample applications providing diverse real-life business solutions. Click to read more and see OpenAccess ORM in action.
0
Chris
Top achievements
Rank 1
answered on 23 Oct 2013, 10:56 AM
Hi,

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


0
Kaloyan Nikolov
Telerik team
answered on 28 Oct 2013, 09:57 AM
Hello Chris,

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.
 

Regards,
Kaloyan Nikolov
Telerik
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
Tags
General Discussions
Asked by
test
Top achievements
Rank 1
Answers by
Serge
Telerik team
test
Top achievements
Rank 1
Patrice Boissonneault
Top achievements
Rank 2
Damyan Bogoev
Telerik team
Mark
Top achievements
Rank 1
PetarP
Telerik team
Chris
Top achievements
Rank 1
Kaloyan Nikolov
Telerik team
Share this question
or