Lazy load a field

4 posts, 1 answers
  1. Chen
    Chen avatar
    18 posts
    Member since:
    Apr 2012

    Posted 06 Jun 2012 Link to this post

    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.
  2. Answer
    Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 06 Jun 2012 Link to this post

    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!
  3. DevCraft banner
  4. Chen
    Chen avatar
    18 posts
    Member since:
    Apr 2012

    Posted 07 Jun 2012 Link to this post

    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
  5. Ivailo
    Admin
    Ivailo avatar
    318 posts

    Posted 11 Jun 2012 Link to this post

    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!
Back to Top