当前位置: 首页>>代码示例>>C#>>正文


C# ISession.Evict方法代码示例

本文整理汇总了C#中ISession.Evict方法的典型用法代码示例。如果您正苦于以下问题:C# ISession.Evict方法的具体用法?C# ISession.Evict怎么用?C# ISession.Evict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISession的用法示例。


在下文中一共展示了ISession.Evict方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddPosAssemblyLog

 /// <summary>
 /// 
 /// </summary>
 /// <param name="session"></param>
 /// <returns></returns>
 public static PosAssemblyLog AddPosAssemblyLog(ISession session)
 {
     var entity = BuildPosAssemblyLog(session);
     session.Save(entity);
     session.Flush();
     session.Evict(entity);
     return entity;
 }
开发者ID:rasheedamir,项目名称:pdms,代码行数:13,代码来源:EntityBuilder.cs

示例2: AddPackageGroup

 /// <summary>
 /// 
 /// </summary>
 /// <param name="session"></param>
 /// <returns></returns>
 public static PackageGroup AddPackageGroup(ISession session)
 {
     var entity = BuildPackageGroup(session);
     session.Save(entity);
     session.Flush();
     session.Evict(entity);
     return entity;
 }
开发者ID:rasheedamir,项目名称:pdms,代码行数:13,代码来源:EntityBuilder.cs

示例3: AddPackageVersion

 /// <summary>
 /// 
 /// </summary>
 /// <param name="session"></param>
 /// <returns></returns>
 public static PackageVersion AddPackageVersion(ISession session)
 {
     var entity = BuildPackageVersion();
     session.Save(entity);
     session.Flush();
     session.Evict(entity);
     return entity;
 }
开发者ID:rasheedamir,项目名称:pdms,代码行数:13,代码来源:EntityBuilder.cs

示例4: AddGroupStore

 /// <summary>
 /// 
 /// </summary>
 /// <param name="session"></param>
 /// <returns></returns>
 public static GroupStore AddGroupStore(ISession session)
 {
     var entity = BuildGroupStore(session);
     session.Save(entity);
     session.Flush();
     session.Evict(entity);
     return entity;
 }
开发者ID:rasheedamir,项目名称:pdms,代码行数:13,代码来源:EntityBuilder.cs

示例5: ScheduleAuditDataRemoval

 /// <summary>
 /// Schedules audit data removal from session level cache after transaction completion. 
 /// The operation is performed regardless of commit success if session still is open.
 /// </summary>
 /// <param name="session">Active NHibernate session</param>
 /// <param name="data">Audit data that shall be evicted (e.g. revision data or entity snapshot)</param>
 public static void ScheduleAuditDataRemoval(ISession session, object data)
 {
     ((IEventSource)session).ActionQueue.RegisterProcess(success =>
                                                             {
                                                                                 if(session.IsOpen)
                                                                                 {
                                                                                     session.Evict(data);
                                                                                 }
                                                             });
 }
开发者ID:umittal,项目名称:MunimJi,代码行数:16,代码来源:SessionCacheCleaner.cs

示例6: GetStaffGroups

        public IList<StaffGroup> GetStaffGroups(Player staff, ISession session)
        {
            ServicesList.SecurityService.CheckPermission(staff, JobEnum.StaffGroupManagement.ToString(), "read");

            ICriteria criteria = session.CreateCriteria<StaffGroup>();
            IList<StaffGroup> staffGroups = criteria.List<StaffGroup>();

            IList<StaffGroup> distinctGroups = new List<StaffGroup>();
            foreach (StaffGroup staffGroup in staffGroups)
            {
                if (!distinctGroups.Contains(staffGroup))
                    distinctGroups.Add(staffGroup);
                else
                    session.Evict(staffGroup);
            }
            return distinctGroups;
        }
开发者ID:DF-thangld,项目名称:web_game,代码行数:17,代码来源:StaffManagementService.cs

示例7: DoInHibernate

 /// <summary>
 /// Gets called by HibernateTemplate with an active
 /// Hibernate Session. Does not need to care about activating or closing
 /// the Session, or handling transactions.
 /// </summary>
 /// <remarks>
 /// <p>
 /// Allows for returning a result object created within the callback, i.e.
 /// a domain object or a collection of domain objects. Note that there's
 /// special support for single step actions: see HibernateTemplate.find etc.
 /// </p>
 /// </remarks>
 public object DoInHibernate(ISession session)
 {
     session.Evict(entity);
     return null;
 }
开发者ID:ouyangyl,项目名称:MySpringNet,代码行数:17,代码来源:HibernateTemplate.cs

示例8: Evict

		private void Evict(ISession session, GridWidget widget)
		{
			session.Evict(widget);
			sessions.Evict(widget.GetType());
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:5,代码来源:Fixture.cs

示例9: initRelacaoHierarquica

        private IList<RelacaoHierarquicaEntity> initRelacaoHierarquica(ISession session, long nivelId)        
        {
            IQuery rhq = session.CreateQuery("select c from RelacaoHierarquicaEntity as c where c.ID.Id = " + nivelId + " AND c.IsDeleted = 0 ");
            rhq.SetTimeout(1000);

            IList<RelacaoHierarquicaEntity> ret = null;

            RelacaoHierarquicaEntity rh = null;            
            if (rhq.List<RelacaoHierarquicaEntity>().Count > 0)
            {
                ret = rhq.List<RelacaoHierarquicaEntity>();
                rh = ret[0];
                if (rh != null)
                {
                    session.Evict(rh);
                    TipoNivelRelacionadoEntity tnr = session.Get<TipoNivelRelacionadoEntity>(rh.TipoNivelRelacionado.Id);
                    if (tnr != null)
                    {
                        if (tnr.Designacao != null)
                        {
                            this.designacaoTipoNivelRelacionado = tnr.Designacao;
                        }                        
                    }                   
                }
            }            

            return ret;
        }
开发者ID:aureliopires,项目名称:gisa,代码行数:28,代码来源:NivelDocumental.cs

示例10: initNivelDesignado

 private void initNivelDesignado(ISession session, long id)
 {         
     NivelDesignadoEntity nd = session.Get<NivelDesignadoEntity>(id);
     if (nd != null && !nd.IsDeleted)
     {
         session.Evict(nd);
         if (nd.Designacao != null)
         {
             this.DesignacaoNivelDesignado = nd.Designacao;
         }
     }
 }
开发者ID:aureliopires,项目名称:gisa,代码行数:12,代码来源:NivelDocumental.cs


注:本文中的ISession.Evict方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。