コード例 #1
0
ファイル: ReplaceEntity.cs プロジェクト: Enzogord/QSProjects
        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
ファイル: DeleteInfo.cs プロジェクト: Enzogord/QSProjects
 public Operation CreateRemoveFromOperation(EntityDTO masterEntity, RemoveFromDependenceInfo depend, IList <EntityDTO> dependEntities)
 {
     throw new NotSupportedException();
 }
コード例 #6
0
ファイル: DeleteInfo.cs プロジェクト: Enzogord/QSProjects
 IList <EntityDTO> IDeleteInfo.GetDependEntities(IDeleteCore core, RemoveFromDependenceInfo depend, EntityDTO masterEntity)
 {
     throw new NotImplementedException();
 }