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


C# ISession.EnableFilter方法代码示例

本文整理汇总了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);
		}
开发者ID:juanplopes,项目名称:nhibernate,代码行数:7,代码来源:Fixture.cs

示例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");
 }
开发者ID:reharik,项目名称:KnowYourTurf.SystemSupport,代码行数:8,代码来源:SysUnitOfWork.cs

示例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);
 }
开发者ID:reharik,项目名称:KnowYourTurf,代码行数:10,代码来源:UnitOfWork.cs

示例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);
        }
开发者ID:reharik,项目名称:MethodFitness,代码行数:11,代码来源:UnitOfWork.cs

示例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);
        }
开发者ID:neozhu,项目名称:MrCMS,代码行数:11,代码来源:SiteFilterDisabler.cs

示例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;
 }
开发者ID:night-king,项目名称:NHibernate-Shards,代码行数:14,代码来源:ShardedFilterImpl.cs

示例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();
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:20,代码来源:Fixture.cs

示例8: SetSession

 public override void SetSession(ISession session)
 {
     session.EnableFilter("DeletedFilter").SetParameter("IsDeleted", false);
 }
开发者ID:umutyenilmis,项目名称:SignalR-Demo,代码行数:4,代码来源:EnableFiltersInterceptor.cs

示例9: OnOpenSession

 public void OnOpenSession(ISession session)
 {
     session.EnableFilter(filterName);
 }
开发者ID:spib,项目名称:nhcontrib,代码行数:4,代码来源:EnableFilterOpenSessionEvent.cs


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