dbelmont / ExpressionBuilder

A library that provides a simple way to create lambda expressions to filter lists and database queries.
Apache License 2.0
372 stars 105 forks source link

Add ability to include non generic usage #25

Closed radenkozec closed 5 years ago

radenkozec commented 6 years ago

For me is the problem to provide generic type like this: var filter = new Filter<Person>(); What I need is:

var type = Type.GetType("Bla." + mappedEntityTableName + "RecievedLog");
var filter = new Filter(type);

Can you provide this version?

dbelmont commented 6 years ago

Hi @radenkozec, Sorry for the late reply. I'll have a look at this. I'll let you know when it's available. Cheers.

dbelmont commented 5 years ago

Hi @radenkozec,

I created a new class called FilterFactory to enable the creation of filters without using generics. Something like this:

var filter = FilterFactory.Create(typeof(Person));

I added this to a pre-release package at NuGet.org. Would you mind checking that out and letting me know what you think about it?

Many thanks, David

radenkozec commented 5 years ago

@dbelmont Thanks for your effort. I managed to solve this in some other way. To be honest I don't remember how. Probably not using your library. Hopefully someone will find this feature useful.