Filtering by default on entities

Posts   
 
    
wtijsma
User
Posts: 252
Joined: 18-Apr-2006
# Posted on: 05-Jun-2008 13:43:22   

Hi,

I'm wondering if something like this is already possible:

I would like to have a default PredicateFactory for my entities, similar to the IConcurrencyPredicateFactory, that would always add a predicate when fetching an entity.

This could be useful in some occasions:

  • Soft deleting entities
  • Date range filtering for active entities
  • Security filtering on entities
  • etc.

For example I have an entity with a Deleted bit field, and by default I would never want entities where Deleted=1, but I don't want to add the predicate on all my (LinqMetaData) fetches, especially with prefetching related entities it tends to get a bit messy.

The deleted bit isn't that bad, but prefetching combined with security predicates or date range filtering it becomes impossible to follow within no time.

With the 'old' predicate system it would be easy to make 'reusable' predicates, however I'm looking for something that works on the background together with LinqMetaData fetches.

Thanks!

Wiebe

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 05-Jun-2008 16:23:42   

Please check the following thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=9347

  • Security filtering on entities

Also you may check LLBLGen Pro's Authorization framework for this part.

wtijsma
User
Posts: 252
Joined: 18-Apr-2006
# Posted on: 06-Jun-2008 14:53:35   

Walaa wrote:

Please check the following thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=9347

  • Security filtering on entities

Also you may check LLBLGen Pro's Authorization framework for this part.

Thanks! overriding the

IRetrievalQuery CreateSelectDQ()

of the DataAccessAdapter does allow me to do what I want.

I checked the Auditing and Authorization framework, but it only seems to do stuff in-memory, it does give some more control by hooking in to all sorts of events, but that's basically it right?

BTW the linq stuff works great simple_smile

Wiebe

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 06-Jun-2008 15:15:41   

I checked the Auditing and Authorization framework, but it only seems to do stuff in-memory, it does give some more control by hooking in to all sorts of events, but that's basically it right?

Authorization does filtering in memory. Auditing lets you persist auditing information in the database.