henkmollema / Dommel

CRUD operations with Dapper made simple.
MIT License
634 stars 100 forks source link

Being able to use Type[] as a parameter when using multimapping #258

Closed Jlll1 closed 2 years ago

Jlll1 commented 3 years ago

I think it'd be much more convenient if we were able to pass a Type[] as a parameter to a Get() method. Right now building queries with variable includes results in a unnecessary large amount of code. MultiMap already passes an array of types to BuildMultiMapQuery, so if there was an overload where you could do something like:

var includeTypes = new[] { typeof(T1), typeof(T2) }; connection.GetAll<ReturnType>(includeTypes);

it would make it much easier to work with. I could submit a PR if you'd like.

henkmollema commented 3 years ago

I'm not sure we should add this, perhaps calling Dapper directly is better in this case. Can you create a (simple) PR which demonstrates what this would look like? Perhaps I can be convinced otherwise. 😄