本文整理汇总了C#中ISession.EnableFilter方法的典型用法代码示例。如果您正苦于以下问题:C# ISession.EnableFilter方法的具体用法?C# ISession.EnableFilter怎么用?C# ISession.EnableFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISession
的用法示例。
在下文中一共展示了ISession.EnableFilter方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: enableFilters
private static void enableFilters(ISession s)
{
IFilter f = s.EnableFilter("activeChild");
f.SetParameter("active", 1);
IFilter f2 = s.EnableFilter("alwaysValid");
f2.SetParameter("always", 1);
}
示例2: SysUnitOfWork
public SysUnitOfWork(ISession session) : base(session)
{
_session = session;
var enableDeletdFilter = _session.EnableFilter("IsDeletedConditionFilter");
var enableStatusFilter = _session.EnableFilter("StatusConditionFilter");
if (enableDeletdFilter != null) enableDeletdFilter.SetParameter("IsDeleted", false);
if (enableStatusFilter != null) enableStatusFilter.SetParameter("condition", "Active");
}
示例3: UnitOfWork
public UnitOfWork(ISession session,IGetCompanyIdService getCompanyIdService)
{
_session = session;
var enableCoFilter = _session.EnableFilter("CompanyConditionFilter");
var enableDeletdFilter = _session.EnableFilter("IsDeletedConditionFilter");
if(enableCoFilter!=null)
enableCoFilter.SetParameter("CompanyId", ObjectFactory.Container.GetInstance<IGetCompanyIdService>().Execute());
if (enableDeletdFilter!= null)
enableDeletdFilter.SetParameter("IsDeleted", false);
}
示例4: UnitOfWork
public UnitOfWork(ISession session, ISessionContext sessionContext)
{
_session = session;
_sessionContext = sessionContext;
var enableOrgFilter = _session.EnableFilter("OrgConditionFilter");
var enableDeleteFilter = _session.EnableFilter("DeletedConditionFilter");
if (enableOrgFilter == null) return;
enableOrgFilter.SetParameter("OrgId", _sessionContext.GetOrgId());
enableDeleteFilter.SetParameter("Archived", false);
}
示例5: TemporarySiteFilter
public TemporarySiteFilter(ISession session,Site site)
{
_session = session;
_filterEnabled = _session.GetEnabledFilter("SiteFilter") != null;
if (_filterEnabled)
{
_session.DisableFilter("SiteFilter");
}
_session.EnableFilter("SiteFilter").SetParameter("site", site.Id);
}
示例6: EnableFor
public IFilter EnableFor(ISession session)
{
IFilter result;
if (!this.enabledFiltersBySession.TryGetValue(session, out result))
{
result = session.EnableFilter(this.filterName);
foreach (var action in enableActions)
{
action(result);
}
enabledFiltersBySession.Add(session, result);
}
return result;
}
示例7: OnSetUp
protected override void OnSetUp()
{
base.OnSetUp();
session = OpenSession();
transaction = session.BeginTransaction();
device = new Device();
session.Save(device);
var ev = new Event {Date = date, SendedBy = device};
session.Save(ev);
var d = new Description {Event = ev, Value = "Test", LanguageID = "it"};
session.Save(d);
IFilter f = session.EnableFilter("LanguageFilter").SetParameter("LanguageID", "it");
f.Validate();
}
示例8: SetSession
public override void SetSession(ISession session)
{
session.EnableFilter("DeletedFilter").SetParameter("IsDeleted", false);
}
示例9: OnOpenSession
public void OnOpenSession(ISession session)
{
session.EnableFilter(filterName);
}