I am studying RavenDB for use on the system (mainly as a persistent cache key) and you need to know what are the limitations of the actual data that can be saved.
The documentation says "The only requirement is the property of the identifier string of the root of the entity", however, all the samples and tutorials that I see are stored simply string, int, decimal, bool.
Can this object be saved?
public class StorableObject {
public string Id {get;set;}
public object ValueObject {get;set;}
}
Using this (sudo) code?
string boundary = Guid.NewGuid().ToString();
HttpWebRequest request = HttpWebRequest.Create("http://twitpic.com/api/uploadAndPost")
as HttpWebRequest;
request.Method = "POST";
request.ContentType = string.Format("multipart/form-data; boundary={0}", boundary);
request.PreAuthenticate = true;
var objectToStore = new StorableObject { ValueObject = request };
session.Store(objectToStore);
session.SaveChanges();
And return it like this:
var storedObject = session.Load<StorableObject>("objects/123456789");
var request = (HttpWebRequest) storedObject.ValueObject;
Thanks for your feedback, please excuse my far-fetched example, it was the easiest way to describe what I'm trying to do without delving into a bunch of domain knowledge / models.
Kyle
source
share