Click here to Skip to main content
15,511,353 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# to Mysql Login code Error Pin
Dave Kreskowiak22-Mar-22 2:43
mveDave Kreskowiak22-Mar-22 2:43 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 2:44
N Mohamed rafi22-Mar-22 2:44 
GeneralRe: C# to Mysql Login code Error Pin
Dave Kreskowiak22-Mar-22 2:45
mveDave Kreskowiak22-Mar-22 2:45 
GeneralRe: C# to Mysql Login code Error Pin
N Mohamed rafi22-Mar-22 2:46
N Mohamed rafi22-Mar-22 2:46 
GeneralRe: C# to Mysql Login code Error Pin
Dave Kreskowiak22-Mar-22 2:49
mveDave Kreskowiak22-Mar-22 2:49 
QuestionC# - managing JSON serialisation Pin
DerekT-P21-Mar-22 1:32
professionalDerekT-P21-Mar-22 1:32 
AnswerRe: C# - managing JSON serialisation Pin
Richard Deeming21-Mar-22 3:10
mveRichard Deeming21-Mar-22 3:10 
GeneralRe: C# - managing JSON serialisation Pin
DerekT-P21-Mar-22 4:21
professionalDerekT-P21-Mar-22 4:21 
Richard Deeming wrote:
You can't change attributes at run-time;
yes, quite; but it's whether you can then use those attributes at run-time, as a sort of "selector" for which properties to serialise.

Using a separate DTO for each use-case seems like overkill, and having experimented with just one required much more coding than I'd like to do. It also means rebuilding the business layer DLL if I need to add in a property or create a new use-case.

I rather suspect that since there are quite a number of objects, each with a couple of different use-cases, the simplest thing (development-wise) might be to just build up the JSON response "by hand" as it were, and simply return the JSON string to the caller rather than having it built dynamically by the serializer. Then the task of adding a property or two becomes trivial and only affects the webservice methods that actually need to return them.

I'd just hoped there would be an easy way to return an object from a webservice referencing a custom attribute that would act like a "where" clause to select the properties I need... This is a personal "side" project so don't want to spend too much time on it and if a "quick and dirty" solution works, so be it...

Thanks Richard!
GeneralRe: C# - managing JSON serialisation Pin
Richard Deeming21-Mar-22 4:28
mveRichard Deeming21-Mar-22 4:28 
AnswerRe: C# - managing JSON serialisation Pin
Gerry Schmitz21-Mar-22 5:59
mveGerry Schmitz21-Mar-22 5:59 
GeneralRe: C# - managing JSON serialisation Pin
DerekT-P21-Mar-22 8:26
professionalDerekT-P21-Mar-22 8:26 
AnswerRe: C# - managing JSON serialisation Pin
Eddy Vluggen21-Mar-22 8:02
professionalEddy Vluggen21-Mar-22 8:02 
GeneralRe: C# - managing JSON serialisation Pin
DerekT-P21-Mar-22 8:34
professionalDerekT-P21-Mar-22 8:34 
QuestionRe: C# - managing JSON serialisation Pin
Eddy Vluggen21-Mar-22 13:26
professionalEddy Vluggen21-Mar-22 13:26 
QuestionNeed C# and Mysql Tutorial Pin
N Mohamed rafi20-Mar-22 19:13
N Mohamed rafi20-Mar-22 19:13 
AnswerRe: Need C# and Mysql Tutorial Pin
OriginalGriff20-Mar-22 21:43
mveOriginalGriff20-Mar-22 21:43 
AnswerRe: Need C# and Mysql Tutorial Pin
RobertSF21-Mar-22 11:29
professionalRobertSF21-Mar-22 11:29 
GeneralMysql Update Query Error Pin
N Mohamed rafi20-Mar-22 6:25
N Mohamed rafi20-Mar-22 6:25 
GeneralRe: Mysql Update Query Error Pin
Victor Nijegorodov20-Mar-22 8:47
Victor Nijegorodov20-Mar-22 8:47 
GeneralRe: Mysql Update Query Error Pin
N Mohamed rafi20-Mar-22 9:44
N Mohamed rafi20-Mar-22 9:44 
SuggestionRe: Mysql Update Query Error Pin
Eddy Vluggen20-Mar-22 9:40
professionalEddy Vluggen20-Mar-22 9:40 
GeneralRe: Mysql Update Query Error Pin
N Mohamed rafi20-Mar-22 9:45
N Mohamed rafi20-Mar-22 9:45 
GeneralRe: Mysql Update Query Error Pin
OriginalGriff20-Mar-22 9:47
mveOriginalGriff20-Mar-22 9:47 
GeneralRe: Mysql Update Query Error Pin
Eddy Vluggen20-Mar-22 10:43
professionalEddy Vluggen20-Mar-22 10:43 
GeneralRe: Mysql Update Query Error Pin
OriginalGriff20-Mar-22 10:46
mveOriginalGriff20-Mar-22 10:46 

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.