protected override void AddItem(T entity) { string id; if (GetPrimaryKey(entity, out id) && Equals(id, default(string))) { id = GeneratePrimaryKey(); SetPrimaryKey(entity, id); } Client.CreateDocument(entity, id); }
protected override void AddItem(T entity) { string id = null; if (GetPrimaryKey(entity, out TKey entityId) && GenerateKeyOnAdd && Equals(entityId.ToString(), default(string))) { id = GeneratePrimaryKey(); SetCouchDbPrimaryKey(entity, id); } Client.CreateDocument(entity, id); }