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

Why transient type change the context model?

1 Answer 41 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nelson
Top achievements
Rank 1
Nelson asked on 09 Sep 2011, 06:53 PM
hi telerik,

I use, in some of my entities, transient type attributes.

However, I have some problems with it. When I change the value of a transient type attribute, my context model also changes (HasChanges gets true). I've checked the ORM generated file and those transient attributes are there, exposed, like the rest of the attributes that are related to fields in the database...

 WHY does this happens if the functionality of a transient is to store data in a not persistent way?

Can someone tell me how can I work arround this "problem"?
Is there any way, or attribute/property type similar to transient but doens't change the context when his value changes?

Thanks in advance,
Nelson

1 Answer, 1 is accepted

Sort by
0
Ivailo
Telerik team
answered on 14 Sep 2011, 03:58 PM
Hello Nelson,

In general, if you are using the new Visual Designer for your Domain model (stored in RLINQ file), you have the alternative approach of defining your attributes in partial classes at your disposal, as described in detail in the relevant help article. With the Fluent Mapping API each property that is not mapped is considered non-persistent and should not cause a context change to be recorded.

Transient attribute is used in the Classic OpenAccess ORM API where the Visual Designer is not available. Changing the value of a property with Transient attribute should not trigger any changes in the context - if you call GetChanges(), the results should not contain any update for the particular property. In order to be able to reproduce the incident, we will need some additional information regarding your scenario - what is "HasChanges" and what changes are you able to retrieve from the context?

I am looking forward to your feedback.


Best wishes,
Ivailo
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

Tags
Databases and Data Types
Asked by
Nelson
Top achievements
Rank 1
Answers by
Ivailo
Telerik team
Share this question
or