Skip to content

Enhancement: Support for returning IDictionary<string, object> instead of ExpandoObject. #537

@isaacabraham

Description

@isaacabraham

F# doesn't have "out of the box" support for dynamic typing (although it's something that you could add support for). Instead, it would be nice to be able to request an IDictionary<String,Object>> from a query e.g.

let data = conn.ExecuteQuery<IDictionary<string, obj>> "SELECT Col1, Col2 FROM Table" // data is type IEnumerable<IDictionary<string, obj>>

let stuff = data |> Seq.map(fun row -> row.["Col1"]) // get a list of all Col1 values

You can work around this with a one liner, but not everyone (and especially developers with no C# experience) will know how to do this:

let data = conn.ExecuteQuery "SELECT Col1, Col2 FROM Table" // data is type IEnumerable<obj>
let dataAsDict = data |> Seq.cast<IDictionary<string, obj>> // dataAsDict is type IEnumerable<IDictionary<string,obj>>

Metadata

Metadata

Assignees

Labels

deployedFeature or bug is deployed at the current releasefeatureDefined as a big development item (feature)fixedThe bug, issue, incident has been fixed.requestA request from the community.todoThings to be done in the future

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions