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?

leppie
  • 115,091
  • 17
  • 196
  • 297
Contango
  • 76,540
  • 58
  • 260
  • 305
  • 1
    Have you considered LINQ-TO-SQL? – PhillyNJ May 04 '15 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. – Contango May 04 '15 at 15:00
  • Related: http://stackoverflow.com/questions/16788242/how-do-i-use-automapper-to-map-a-dataset-with-multiple-tables – Contango May 04 '15 at 15:06

1 Answers1

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.

Community
  • 1
  • 1
Contango
  • 76,540
  • 58
  • 260
  • 305