in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

one to one association - delayed loading

Last post 11/15/2008 5:01 AM by Koray Taylan Davgana. 0 replies.
Page 1 of 1 (1 items)
Sort Posts:
Previous Next
  • 11/15/2008 5:01 AM

    one to one association - delayed loading

    hi,

    i have a one to one association between user and userinfo classes. user has the light info needed all time like name id etc and userinfo has the heavy load with all detail including adresses telephones notes and so on.

    so i want to make the userinfo property delayed in user class to gain performance.

    delayed loading mentioned like this in documentation

    [Delayed] public Byte[ BigPicture { get { return GetDelayedPropertyValue<Byte[>("BigPicture"); } set { SetDelayedPropertyValue<Byte[>("BigPicture", value); } }

    and i'm defining the associated property like this,

    private UserInfo _UserInfo;
            [Aggregated, Association("User-UserInfo")]
            [Indexed(Unique = true)]
            public UserInfo UserInfo
            {
                get
                {
                    return _UserInfo;
                }
                set
                {
                    if (_UserInfo == value)
                        return;

                    UserInfo prev_UserInfo = _UserInfo;
                    _UserInfo = value;

                    if (IsLoading) return;

                    if (prev_UserInfo != null && prev_UserInfo.User == this)
                        prev_UserInfo.User = null;

                    if (_UserInfo != null)
                        _UserInfo.User = this;
                    OnChanged("UserInfo");
                }
            }

    how do i make it delayed??


    Thanks.

Page 1 of 1 (1 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED