Why transient type change the context model?

Thread is closed for posting
2 posts, 0 answers
  1. Nelson
    Nelson avatar
    62 posts
    Member since:
    Apr 2011

    Posted 09 Sep 2011 Link to this post

    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,
  2. Ivailo
    Ivailo avatar
    318 posts

    Posted 14 Sep 2011 Link to this post

    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,
    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 >>

Back to Top