Skip to content
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.

Filter not working #26

Open
DanielGrandis opened this issue Jul 21, 2016 · 1 comment
Open

Filter not working #26

DanielGrandis opened this issue Jul 21, 2016 · 1 comment

Comments

@DanielGrandis
Copy link

Hi, I'm try to use filter by this way:

During OnModelCreating:

`base.OnModelCreating(modelBuilder);

        #region Tenant Configurations            
        MultiTenancyConfigurations.Configure(modelBuilder);           
        DbInterception.Add(new FilterInterceptor());`

where MultiTenancyConfigurations.Configure do this job:

modelBuilder.Conventions.Add( FilterConvention.Create<CalendarEvent, Guid>("CalendarEvent_Filter", (e, tenantId) => e.TenantId == tenantId));

and, on DbContext initialization, I have:

this.EnableFilter("CalendarEvent_Filter").SetParameter("tenantId", EngineContext.Current.CurrentUserId);

where EngineContext.Current.CurrentUserId return Guid UserId from ClaimIdentity of the logged in user (I see in debug mode that parameter war return correctly). No way: for every user I still receive all the events from the database, no way to get it filtered by TenantId parameter setted.

I'm forgetting something? I can get it work!

Thanks in advance!

Daniel

@schuettecarsten
Copy link

Same problem here :-(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants