Exemplo n.º 1
0
        public virtual DbItem GetOrCreateItem(int? fromId, string identifier)
        {
            var relation = GetRelation(fromId, identifier);
            if (relation != null && relation.ToId == null)
            {
                Delete(relation);
                relation = null;
            }

            if (relation == null)
            {
                var item = new DbItem();

                Insert(item);

                Insert(new DbRelation
                                  {
                                      FromId = fromId,
                                      Identifier = identifier,
                                      ToId = item.Id
                                  });

                return item;
            }

            return GetItem(relation.ToId.Value);
        }
Exemplo n.º 2
0
 public abstract void Update(DbItem item);
Exemplo n.º 3
0
 public abstract void Insert(DbItem item);
Exemplo n.º 4
0
 public abstract void Delete(DbItem item);
Exemplo n.º 5
0
 public abstract void Delete(DbItem item);
Exemplo n.º 6
0
 public abstract void Update(DbItem item);
Exemplo n.º 7
0
 public abstract void Insert(DbItem item);