Questions tagged as 'newtonsoft'

2
answers

How to create a class and pass a value of an attribute in the class constructor in C #

Hello, I'm doing an integration with the Tray Comerce API and thought about generating a generic class with the list answer . In all listings, the API implements the following return class: public class Response<T> { [JsonPropert...
asked by 20.06.2018 / 15:34
1
answer

Read a value inside a complex JSON in C #

Good morning everyone! I am new to C # and am having a hard time getting a value inside a complex Json. Json is this: { "id": "58e50b82-50b1-4f29-a2e8-a9a544013255", "timestamp": "2018-06-20T18:00:12.935Z", "lang": "pt-br", "result":...
asked by 25.06.2018 / 14:45
2
answers

What is the best way to add a static method to an existing C # class?

I'm creating a restfull application that uses the Newtonsoft library to send information through controllers . In my application, I have numerous classes like for example the user: public class UsuarioModel { public int Id { get; set;...
asked by 23.11.2018 / 14:54
0
answers

How to deserialize a JEnumerable to a list of classes in C # in a ClassT (generic class)

Hello, I'm having trouble deserializing a node from a JSON object to a list. The object I have is the following: { "paging": {"total":67, "page":1, "offset":0, "limit":30, "maxLimit":50 }, "sort": [ {"id":"asc"} ], "availableFilters":...
asked by 09.07.2018 / 16:27
0
answers

How to convert a json return into a C # object to display the result on the [duplicate]

I'm having a problem while reading a JSON and convert to an Object and display the data on the screen using C # , I'm using the Newtonsoft and would like to know how to check if the data type is an array and check if it is empty? Here i...
asked by 15.05.2018 / 02:20