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

Lazy load a field

3 Answers 118 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.
Chen
Top achievements
Rank 1
Chen asked on 06 Jun 2012, 01:58 PM
I have a question about the mapping of big field.

Let's say I have a database table with two fields: FileName and FileContent. The FileContent is a array of bytes and could be very large (7MB, for example). I mapped this table to a class with two properties: FileName (string) and FileContent (byte[]). Is it possible that I do not load the FileContent field to the class property till I need it?

Thanks in advance for any input.

3 Answers, 1 is accepted

Sort by
0
Accepted
Jan Blessenohl
Telerik team
answered on 06 Jun 2012, 04:46 PM
Hello Yuan,
you can do that by setting the fields LoadBehavior to Lazy. This can be done in the DSL by changing the field properties or in the fluent api by using the HasProperty(x=>x.. extension.

Greetings,
Jan Blessenohl
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
0
Chen
Top achievements
Rank 1
answered on 07 Jun 2012, 01:58 PM
Hi Jan,

Thanks a lot for your help. I got this problem solved.

I was wondering if you have some documents for me to learn the advanced features for the OpenAccess since I am new for it.

Thanks.

Chen
0
Ivailo
Telerik team
answered on 11 Jun 2012, 06:57 PM
Hello Chen,

Here are some general directions. 
- Fluent API reference (if you are working code-only, without a visual diagram)
- Context API reference, in case you are using the Visual Designer
- ADO API reference, if you would like a more direct database access, similar to ADO.NET

In order to get started, you can check out our video series for mapping your database using the Visual Designer or the Code-Only approach. Also, feel free to use the "Getting Started with Telerik OpenAccess ORM" PDF file that is deployed together with OpenAccess ORM. 

And finally, for code samples and tutorials presenting real scenarios you can download and try the OpenAccess SDK.

Let us know what areas of OpenAccess are you interested in and we can direct you more specifically and list a lot of useful resources that would speed up your development. 

All the best,
Ivailo
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Tags
General Discussions
Asked by
Chen
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Chen
Top achievements
Rank 1
Ivailo
Telerik team
Share this question
or