protected override bool RemoveInternal(T item) { MaterializeModifiedCollection(); string id = CouchDBContextImpl.GetEntityInstanceId(item); return(modifiedCollection.Remove(id)); }
/// <summary> /// Add new entity to the identity map. /// </summary> /// <param name="entity"></param> public void AddNewEntity(object entity) { string id = CouchDBContextImpl.GetEntityInstanceId(entity); idToEntity.Add(id, entity); entityToId.Add(entity, id); }
protected override void AddInternal(T item) { MaterializeModifiedCollection(); string id = CouchDBContextImpl.GetEntityInstanceId(item); modifiedCollection.Add(id); }
public AssociationList( object owner, string[] keys, CouchDBContextImpl context, AssociationAttribute associationAttr) : base(owner, context, associationAttr) { this.keys = keys; }
public AssociationSet( object owner, string[] keys, CouchDBContextImpl context, AssociationAttribute associationAttr) : base(owner, context, associationAttr) { this.keys = new HashSet <string>(keys); }
public ReduceView(CouchDBContextImpl couchDBContext, string viewName) { this.couchDBContext = couchDBContext; this.viewName = viewName; options = new CouchViewOptions { Group = true }; }
public AssociationCollection( object owner, CouchDBContextImpl context, AssociationAttribute associationAttr) { this.owner = owner; this.context = context; this.associationAttr = associationAttr; }
// Note: We use explicit implementation because object itself has // Equals(object x, object y) method. bool IEqualityComparer <object> .Equals(object x, object y) { string xid = CouchDBContextImpl.GetEntityInstanceId(x); string yid = CouchDBContextImpl.GetEntityInstanceId(y); bool equals = object.Equals(xid, yid); return(equals); }
public IdentityMap(CouchDBContextImpl context) { idToEntity = new Dictionary <string, object>(); // Initialize entity to ID map. We use EntityID to match // given entity to this map, not object identity (reference equals). entityToId = new Dictionary <object, string>(entityIdComparer); this.context = context; }
public OdmView(CouchDBContextImpl couchDBContext, string viewName) { this.couchDBContext = couchDBContext; this.viewName = viewName; assoicateCollectionsToLoad = new List <Tuple <string, object> >(); options = new CouchViewOptions { IncludeDocs = true }; }
/// <summary> /// Only this assembly can create DeleteByView instance. /// </summary> internal DeleteByView(CouchDBContextImpl couchDBContext, string viewName) { this.couchDBContext = couchDBContext; this.viewName = viewName; }
public Serializer(CouchDBContextImpl context) { this.context = context; }
int IEqualityComparer <object> .GetHashCode(object obj) { string entityId = CouchDBContextImpl.GetEntityInstanceId(obj); return(entityId.GetHashCode()); }