private static IList GetLinkedEntities(IUnitOfWork uow, RemoveFromDependenceInfo depend, IDomainObject masterEntity) { var list = uow.Session.CreateCriteria(depend.ObjectClass) .CreateAlias(depend.CollectionName, "childs") .Add(Restrictions.Eq(String.Format("childs.Id", depend.CollectionName), masterEntity.Id)).List(); return(list); }
IList <EntityDTO> IDeleteInfo.GetDependEntities(IDeleteCore core, RemoveFromDependenceInfo depend, EntityDTO masterEntity) { var list = core.UoW.Session.CreateCriteria(ObjectClass) .CreateAlias(depend.CollectionName, "childs") .Add(Restrictions.Eq(String.Format("childs.Id", depend.CollectionName), (int)masterEntity.Id)).List(); return(MakeResultList(list)); }
public Operation CreateRemoveFromOperation(EntityDTO masterEntity, RemoveFromDependenceInfo depend, IList <EntityDTO> dependEntities) { return(new HibernateRemoveFromCollectionOperation { RemoveInClassType = depend.ObjectClass, RemoveInItems = dependEntities, CollectionName = depend.CollectionName, RemoveMethodName = depend.RemoveMethodName, RemovingEntity = masterEntity }); }
public DeleteInfoHibernate <TEntity> AddRemoveFromDependence <TFrom>(Expression <Func <TFrom, object> > collectionProperty, Expression <Func <TFrom, Action <TEntity> > > removeFunction) { RemoveFromItems.Add(RemoveFromDependenceInfo.CreateFromBag <TFrom, TEntity> (collectionProperty, removeFunction)); return(this); }
public Operation CreateRemoveFromOperation(EntityDTO masterEntity, RemoveFromDependenceInfo depend, IList <EntityDTO> dependEntities) { throw new NotSupportedException(); }
IList <EntityDTO> IDeleteInfo.GetDependEntities(IDeleteCore core, RemoveFromDependenceInfo depend, EntityDTO masterEntity) { throw new NotImplementedException(); }