soitgoes/LoveSeat — Issue #19: CouchDatabase.CreateDocument()
Author: deadok22
Created: 2011-12-13 07:56:31+00:00
State: open

Hi!
Why won't CreateDocument() methods check for existence of "_id" and "_rev" properties?
It is discouraging when you create a Document, set it's "_id" property, then call CouchDatabase.CreateDocument(...) and loose the property.
I suggest checking these properties, or at least adding an overload as follows:

public JObject CreateDocument(Document doc)
{
var documentId = doc.Id;
if (string.IsNullOrEmpty(documentId))
{
return CreateDocument(doc);
}
return CreateDocument(documentId, ObjectSerializer.Serialize(doc));
}

PS thank you for LoveSeat. enjoying it =)