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

Persisting a Class You Didn't Create

1 Answer 41 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jeff
Top achievements
Rank 1
Jeff asked on 03 May 2009, 05:06 AM
I must be missing something basic: I'm trying to persist a System.Drawing.Color object as a field in a persistent class. The OpenAccess compiler tells me this type is not supported and that I must declare it Transient.

    [Telerik.OpenAccess.Persistent] 
    public class ProductVersion 
    { 
        private string m_strModelNumber; 
        private System.Drawing.Color m_ColorRgb; 
    } 

Is there a way to use a class that isn't marked Persistent (like the Color class) as a field?

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 04 May 2009, 05:43 AM
Hello Jeff,

It is not possible to have fields of complex .NET types because they do not have any proper database representation. You can only have references to other classes that are persistent themselves, hence have a database table that represent them.

Sincerely yours,
Zoran
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Getting Started
Asked by
Jeff
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or