Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Multiple column Select doesn't respect ODataPropertyName attribute #131

Copy link
Copy link

Description

@onthepenciltip
Issue body actions

Having some class,

public class Thing
{
    [ODataPropertyName("title")]
    public string Title { get; set; }

    [ODataPropertyName("id")]
    public string Id { get; set; }
}

the next code doesn't work as expected:

var query = new ODataQueryBuilder()
    .For<Thing>("Things")
    .ByList()
    // expected: title,id
    // actual: Title,Id
    .Select(x => new { x.Title, x.Id });
    // allow multiple select as a solution?
    //.Select(x => x.Title)
    //.Select(x => x.Id)
    // or introduce another approach for selecting several columns?

var parts = query.ToDictionary();

We get value Title,Id for $select but expecting title,id.

The documentation talks about using .Select(s => new { s.Id, s.Sum, s.Type }).

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.