Can i use C# dapper to do something like this:
IFoo bar = _dbConnection.Query<IFoo>("My query there");
Now I can't do it, due to not impelemented default parameterless constructor.
Is there some trick to honor gods of SOLID (especially spirits of Liskov Substitution Principle) or should i leave it as it is and map my data not to IFoo but to Foo?
I'm really worrying about respecting these SOLID stuff, but still don't know where i should do it, so looking for an advice for this concrete situation.
IFoo
but you have to tell Dapper what the concrete type is. – juharr Feb 15 '16 at 13:29GetRowParser<T>
(from anIDataReader
) that does something very similar - but you'd still need to tell it the concrete type manually. – Marc Gravell♦ Feb 15 '16 at 16:00