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); }
public abstract void Update(DbItem item);
public abstract void Insert(DbItem item);
public abstract void Delete(DbItem item);