Bryan Stump
Bryan Stump

Reputation: 1439

how to change property mapping in asp core with attributes

I'm trying to change the property name so that I can send my asp core controller method this this json

{
    "Season": 1
}

and map to my C# property

public long SeasonNumber {get; set;}

in old WCF I used to be able to map properties with

[DataMember("Season")]

is there an equivalent for asp core?

Upvotes: 1

Views: 676

Answers (1)

Ppp
Ppp

Reputation: 1015

https://learn.microsoft.com/en-us/dotnet/articles/csharp/tutorials/console-webapiclient

Still is DataMember? Just need to add reference to required library. System.Runtime.Serialization.dll

Upvotes: 2

Related Questions