google-code-export / dataobjectsdotnet

Automatically exported from code.google.com/p/dataobjectsdotnet
0 stars 0 forks source link

Persistent property wrapper #304

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Implement cacheable property wrapper that could be used for properties 
that can't be persisted directly, i.e. image, compressed text, serialized 
object, etc.

Usage example:

class Picture : Entity {

  private PropertyWrapper<Image> imageWrapper;

  public Image
  {
    get { return imageWrapper.GetValue(); }
    set { imageWrapper.SetValue(value); }
  }

  protected void OnBeginTransaction() {

    // To reset cached value
    imageWrapper.Reset();
  }

  public Picture() {

    imageWrapper = new imageWrapper(this, "Image", Image.FromStream, 
Image.Save);
    Session.OnBeginTransaction += OnBegintranscation;
  }
}

Original issue reported on code.google.com by Dmitri.Maximov on 22 Jul 2009 at 8:20

GoogleCodeExporter commented 9 years ago
Wrong proposed usage:
- PropertyWrapper must be a TransactionalStateContainer. 
- There is no OnBeginTransaction in Entity; moreover, it won't ever appear 
there.

Original comment by alex.yakunin on 22 Jul 2009 at 10:09

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by alex.yakunin on 16 Oct 2009 at 9:59