示例#1
0
        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);
        }
示例#2
0
        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));
        }
示例#3
0
 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
     });
 }
示例#4
0
 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);
 }
示例#5
0
 public Operation CreateRemoveFromOperation(EntityDTO masterEntity, RemoveFromDependenceInfo depend, IList <EntityDTO> dependEntities)
 {
     throw new NotSupportedException();
 }
示例#6
0
 IList <EntityDTO> IDeleteInfo.GetDependEntities(IDeleteCore core, RemoveFromDependenceInfo depend, EntityDTO masterEntity)
 {
     throw new NotImplementedException();
 }