O'Reilly logo

RavenDB 2.x Beginner's Guide by Khaled Tannir

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – using attachments to store images

We want to add a flag image to a Country document and we want to store this image as an attachment. You will modify the Country class and add a new property to hold the FlagId value. Then you will add necessary code to store the attachment and modify a Country document to populate the FlagId property in order to refer the attachment. Once it is done, you will observe RavenDB logs to learn how RavenDB stores the attachment.

  1. Start Visual Studio, create a new project and name it RavenDB_Ch06.
  2. Add a new class, name it Country, and make it look like the following code snippet:
    Time for action – using attachments to store images
  3. Add the following code to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required