1

I have a large hand tuned SQL query that returns a flat data table with many (>25) columns.

Currently, I manually convert that to a .NET object with three levels of nesting (i.e. an object which contains (among other properties) a list of further objects which contains (among other properties) a list of further objects.

Is there anything with the ease of something like AutoMapper which can convert a DataTable into a target .NET object, even if its nested?

3
  • 1
    Have you considered LINQ-TO-SQL? Commented May 4, 2015 at 14:35
  • @PhillyNJ Yes, but this is not suitable in this situation. I need this to be an ultra fast query, so a hand optimized SQL query is what I have to start with. This is proving to be at least an order of magnitude faster than Entity Framework. Due to political reasons, I cant slot in another heavyweight ORM framework, so I have to do this particular series of queries manually. Commented May 4, 2015 at 15:00
  • Related: stackoverflow.com/questions/16788242/… Commented May 4, 2015 at 15:06

1 Answer 1

2

I am the original poster of this question.

It turns out that I was asking the wrong question: I should have been asking how to easily perform fast queries which map into a complex arrangement of POCOs.

I have posted the solution that worked perfectly for me, see How do I write one to many query in Dapper.Net? and the answer that references Dapper + Slapper.Automapper.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.