示例#1
0
        protected override bool RemoveInternal(T item)
        {
            MaterializeModifiedCollection();
            string id = CouchDBContextImpl.GetEntityInstanceId(item);

            return(modifiedCollection.Remove(id));
        }
示例#2
0
        /// <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);
        }
示例#3
0
        protected override void AddInternal(T item)
        {
            MaterializeModifiedCollection();
            string id = CouchDBContextImpl.GetEntityInstanceId(item);

            modifiedCollection.Add(id);
        }
示例#4
0
 public AssociationList(
     object owner, string[] keys,
     CouchDBContextImpl context, AssociationAttribute associationAttr)
     : base(owner, context, associationAttr)
 {
     this.keys = keys;
 }
示例#5
0
 public AssociationSet(
     object owner, string[] keys,
     CouchDBContextImpl context, AssociationAttribute associationAttr)
     : base(owner, context, associationAttr)
 {
     this.keys = new HashSet <string>(keys);
 }
示例#6
0
 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;
 }
示例#8
0
            // 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);
            }
示例#9
0
        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;
        }
示例#10
0
        public OdmView(CouchDBContextImpl couchDBContext, string viewName)
        {
            this.couchDBContext = couchDBContext;
            this.viewName       = viewName;

            assoicateCollectionsToLoad = new List <Tuple <string, object> >();
            options = new CouchViewOptions
            {
                IncludeDocs = true
            };
        }
示例#11
0
 /// <summary>
 /// Only this assembly can create DeleteByView instance.
 /// </summary>
 internal DeleteByView(CouchDBContextImpl couchDBContext, string viewName)
 {
     this.couchDBContext = couchDBContext;
     this.viewName       = viewName;
 }
示例#12
0
 public Serializer(CouchDBContextImpl context)
 {
     this.context = context;
 }
示例#13
0
            int IEqualityComparer <object> .GetHashCode(object obj)
            {
                string entityId = CouchDBContextImpl.GetEntityInstanceId(obj);

                return(entityId.GetHashCode());
            }