Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: generic type with value parameter rather than type parameter Pin
Alexander Kindel8-Apr-18 11:18
Alexander Kindel8-Apr-18 11:18 
GeneralRe: generic type with value parameter rather than type parameter Pin
Gerry Schmitz8-Apr-18 12:00
mveGerry Schmitz8-Apr-18 12:00 
GeneralRe: generic type with value parameter rather than type parameter Pin
BillWoodruff9-Apr-18 11:47
professionalBillWoodruff9-Apr-18 11:47 
QuestionIssue Deserializing Json in C# SSIS Script Pin
rhutchins12346-Apr-18 14:27
rhutchins12346-Apr-18 14:27 
AnswerRe: Issue Deserializing Json in C# SSIS Script Pin
OriginalGriff6-Apr-18 21:09
mveOriginalGriff6-Apr-18 21:09 
GeneralRe: Issue Deserializing Json in C# SSIS Script Pin
rhutchins12347-Apr-18 3:01
rhutchins12347-Apr-18 3:01 
AnswerRe: Issue Deserializing Json in C# SSIS Script Pin
Gerry Schmitz7-Apr-18 6:51
mveGerry Schmitz7-Apr-18 6:51 
GeneralRe: Issue Deserializing Json in C# SSIS Script Pin
rhutchins12347-Apr-18 16:37
rhutchins12347-Apr-18 16:37 
Thanks for your feedback, Gerry. I wasn't aware that VS could generate the JSON classes. That's awesome! I had to reinstall VS to get the VS paste special->Paste JSON as Classes to appear, but it the command works now.

I think I understand the root cause of my issues now, but I'm still not quite sure the best way to resolve it. I know you say that the VS generated classes work, but it's actually generating classes that don't compile. This is because there is a field called "name" and a field called "set_name", so "name" definition line fails with the following error:
"The type 'Datum' already contains a definition for 'set_name'". Please see the below code.

I did try getting around this by using [JsonProperty("name")] and capitalizing the field. It made it compile, but it's still failing when I run it.

Is there another way I can get around this in the class definition, or should I somehow figure out how to update the JSON string without messing with the rest of the data before attempting to deserialize it?

public class Datum
{
    public string name { get; set; }
    public string uri { get; set; }
    public string set_name { get; set; }
    public string set_uri { get; set; }
}

GeneralRe: Issue Deserializing Json in C# SSIS Script Pin
Gerry Schmitz8-Apr-18 6:06
mveGerry Schmitz8-Apr-18 6:06 
GeneralRe: Issue Deserializing Json in C# SSIS Script Pin
rhutchins123414-Apr-18 11:05
rhutchins123414-Apr-18 11:05 
QuestionButton hover problem C# Visual Studio UWP Pin
Member 137658766-Apr-18 1:55
Member 137658766-Apr-18 1:55 
AnswerRe: Button hover problem C# Visual Studio UWP Pin
Pete O'Hanlon6-Apr-18 2:18
mvePete O'Hanlon6-Apr-18 2:18 
AnswerRe: Button hover problem C# Visual Studio UWP Pin
Gerry Schmitz6-Apr-18 7:40
mveGerry Schmitz6-Apr-18 7:40 
RantRe: Button hover problem C# Visual Studio UWP Pin
Mycroft Holmes6-Apr-18 13:10
professionalMycroft Holmes6-Apr-18 13:10 
GeneralRe: Button hover problem C# Visual Studio UWP Pin
Gerry Schmitz6-Apr-18 13:44
mveGerry Schmitz6-Apr-18 13:44 
Questionupdatepanel usage with three dropdownlists values into a single textbox Pin
chetan265-Apr-18 9:50
chetan265-Apr-18 9:50 
AnswerRe: updatepanel usage with three dropdownlists values into a single textbox Pin
Gerry Schmitz5-Apr-18 17:20
mveGerry Schmitz5-Apr-18 17:20 
GeneralRe: updatepanel usage with three dropdownlists values into a single textbox Pin
chetan266-Apr-18 3:36
chetan266-Apr-18 3:36 
GeneralRe: updatepanel usage with three dropdownlists values into a single textbox Pin
Gerry Schmitz6-Apr-18 7:34
mveGerry Schmitz6-Apr-18 7:34 
QuestionHow do i to create a bouncing ball in C# Pin
Member 137644515-Apr-18 5:15
Member 137644515-Apr-18 5:15 
AnswerRe: How do i to create a bouncing ball in C# Pin
OriginalGriff5-Apr-18 5:21
mveOriginalGriff5-Apr-18 5:21 
GeneralRe: How do i to create a bouncing ball in C# Pin
Member 137644515-Apr-18 7:29
Member 137644515-Apr-18 7:29 
GeneralRe: How do i to create a bouncing ball in C# Pin
OriginalGriff5-Apr-18 8:10
mveOriginalGriff5-Apr-18 8:10 
PraiseRe: How do i to create a bouncing ball in C# Pin
Member 137644515-Apr-18 8:16
Member 137644515-Apr-18 8:16 
GeneralRe: How do i to create a bouncing ball in C# Pin
OriginalGriff5-Apr-18 8:21
mveOriginalGriff5-Apr-18 8:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.