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

[Serialize] attribute

8 Answers 127 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
FISCAL
Top achievements
Rank 1
FISCAL asked on 11 Oct 2010, 03:33 PM
Hi,

Can telerik open access generate classes with [Serialize] attribute using Reverse Mapping?

Many thanks.

MG

8 Answers, 1 is accepted

Sort by
0
IT-Als
Top achievements
Rank 1
answered on 11 Oct 2010, 04:29 PM
Hi M G,

If you use the latest version you can customize the T4 code template that is used to generate the classes.

Here is a thread that discusses this according to HTML encoding and decoding getters and setters for properties. It should get your started on how to add the [Serializable] attribute.

Regards

Henrik

0
FISCAL
Top achievements
Rank 1
answered on 12 Oct 2010, 03:01 PM
HI Henry,

Thanks for the pointer. I just need to have the label [Serialize] on each classes being generated. Therefore if you can think straight out of you head, could you please let me know where exactly do I have to make changes?

Many thanks.

MG
0
Accepted
Jan Blessenohl
Telerik team
answered on 12 Oct 2010, 03:22 PM
Hi M G,
If you are using 2010 c# please goto dsl2010\CodeGenerationTemplates\CSharp\Includes in the OpenAccess install directory, open General.ttinlcude. At line 371 you find the class generation method. Before

this.WriteLine(classSignature);

is called you can insert what you want to write above the classes. A

this.WriteLine("[System.Serializable]");

will do the job. Just play around a little bit.

Regards,
Jan Blessenohl
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
IT-Als
Top achievements
Rank 1
answered on 12 Oct 2010, 03:26 PM
Hi Jan,

Thanks for joining in - you hit the Reply button just before me :-)
But I was having the same answer though - nothing to add there.

Regards

Henrik
0
FISCAL
Top achievements
Rank 1
answered on 12 Oct 2010, 03:59 PM
Thank a lot to both of you!

Cheers,
MG
0
FISCAL
Top achievements
Rank 1
answered on 01 Jul 2011, 10:21 AM
Hi,

We upgraded OA version to the latest one. The trouble is how can I achieve or add "Serialize" atttribute to each classes being generated.At what line do I have to add the code for the new version.

Many thanks.

MG
0
FISCAL
Top achievements
Rank 1
answered on 01 Jul 2011, 01:38 PM
Sorry. Not to worry about the issue. I found a solution myself. Added in "specific.ttinclude" file.

Thx,
MG
0
Damyan Bogoev
Telerik team
answered on 01 Jul 2011, 04:00 PM
Hi Milan,

I am glad to see that you managed to resolve the problem on your side.
If any other problems arise, do not hesitate to contact us back.

Regards,
Damyan Bogoev
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
Tags
Design Time (Visual Designer & Tools)
Asked by
FISCAL
Top achievements
Rank 1
Answers by
IT-Als
Top achievements
Rank 1
FISCAL
Top achievements
Rank 1
Jan Blessenohl
Telerik team
Damyan Bogoev
Telerik team
Share this question
or