-
Perhaps I'm missing something obvious - but is there no way to get a result set of primitive types back without resorting to using a data reader. For example, how do I do something along the lines of: var query = SQL
.SELECT("p.ProductName")
.FROM("Products p");
IEnumerable<string> names = conn.Map<string>(query); |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Currently, you have to explicitly provide a mapping delegate, otherwise it asumes you want to map columns to properties of the type parameter (String on this case): IEnumerable<string> names = conn.Map<string>(query, r => r.GetString(0)); |
Beta Was this translation helpful? Give feedback.
-
With type inference you can ommit the type parameter: IEnumerable<string> names = conn.Map(query, r => r.GetString(0)); |
Beta Was this translation helpful? Give feedback.
-
Works perfectly, thanks again! |
Beta Was this translation helpful? Give feedback.
Currently, you have to explicitly provide a mapping delegate, otherwise it asumes you want to map columns to properties of the type parameter (String on this case):