Skip to content

Implement typed properties#71

Merged
boma96 merged 3 commits into
masterfrom
feat/master/parameter-casting
Nov 23, 2022
Merged

Implement typed properties#71
boma96 merged 3 commits into
masterfrom
feat/master/parameter-casting

Conversation

@boma96

@boma96 boma96 commented Nov 23, 2022

Copy link
Copy Markdown
Collaborator

Currently, there is no way for dynamic properties to be assigned to strongly typed input properties.
This PR implements a solution that requires the library user to define correction for output class in which the user can define strongly typed properties with help of TypedProperty attribute.

Example output class:

public partial class CustomerGetV1Output
{
    /// <originalName>
    /// name
    /// </originalName>
    public dynamic Name { get; set; }

    /// <originalName>
    /// address
    /// </originalName>
    public dynamic Address { get; set; }
}

Example correction class

public partial class CustomerGetV1Output
{
        [TypedProperty(nameof(Address))]
        public string AddressString { get; set; }

        [TypedProperty(nameof(Name))]
        public string NameString { get; set; }
}

@boma96
boma96 requested a review from ognjenkatic November 23, 2022 11:46
@boma96
boma96 merged commit 9e73396 into master Nov 23, 2022
@boma96
boma96 deleted the feat/master/parameter-casting branch November 23, 2022 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants