Ejemplo n.º 1
0
        private void SaveLink(T entity, ILink link)
        {
            if (entity == null || link == null)
            {
                return;
            }

            var entityId = cache.GetId(entity);

            if (entityId == 0)
            {
                return;
            }

            var id = cache.GetId(link);

            if (id > 0)
            {
                database.SaveLink(this, id, link, entityId);
            }
            else
            {
                id = database.CreateLink(this, link, entityId);
                cache.Add(id, entity, link);
            }
        }