本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
});
}
示例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;
}
示例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;
}
示例8: Evict
private void Evict(ISession session, GridWidget widget)
{
session.Evict(widget);
sessions.Evict(widget.GetType());
}
示例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;
}
示例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;
}
}
}