Click here to Skip to main content
15,902,492 members
Home / Discussions / C#
   

C#

 
GeneralRe: Google PeopleAPI & HttpListener Redirect URI Pin
Kevin Marois26-Jun-23 16:19
professionalKevin Marois26-Jun-23 16:19 
GeneralRe: Google PeopleAPI & HttpListener Redirect URI Pin
jschell27-Jun-23 4:48
jschell27-Jun-23 4:48 
General[UPDATE] - Google PeopleAPI & HttpListener Redirect URI Pin
Kevin Marois27-Jun-23 6:01
professionalKevin Marois27-Jun-23 6:01 
GeneralRe: [UPDATE] - Google PeopleAPI & HttpListener Redirect URI Pin
jschell28-Jun-23 5:54
jschell28-Jun-23 5:54 
QuestionThreading related naming and usage of const Pin
HobbyProggy20-Jun-23 5:04
professionalHobbyProggy20-Jun-23 5:04 
AnswerRe: Threading related naming and usage of const Pin
Richard Deeming20-Jun-23 6:05
mveRichard Deeming20-Jun-23 6:05 
GeneralRe: Threading related naming and usage of const Pin
HobbyProggy20-Jun-23 23:02
professionalHobbyProggy20-Jun-23 23:02 
GeneralRe: Threading related naming and usage of const Pin
Richard Deeming20-Jun-23 23:26
mveRichard Deeming20-Jun-23 23:26 
GeneralRe: Threading related naming and usage of const Pin
HobbyProggy21-Jun-23 2:02
professionalHobbyProggy21-Jun-23 2:02 
GeneralRe: Threading related naming and usage of const Pin
Richard Deeming21-Jun-23 2:22
mveRichard Deeming21-Jun-23 2:22 
GeneralRe: Threading related naming and usage of const Pin
HobbyProggy21-Jun-23 3:16
professionalHobbyProggy21-Jun-23 3:16 
GeneralRe: Threading related naming and usage of const Pin
harold aptroot20-Jun-23 15:07
harold aptroot20-Jun-23 15:07 
GeneralRe: Threading related naming and usage of const Pin
HobbyProggy20-Jun-23 23:04
professionalHobbyProggy20-Jun-23 23:04 
AnswerRe: Threading related naming and usage of const Pin
Gerry Schmitz21-Jun-23 4:42
mveGerry Schmitz21-Jun-23 4:42 
AnswerRe: Threading related naming and usage of const Pin
jschell23-Jun-23 10:53
jschell23-Jun-23 10:53 
GeneralRe: Threading related naming and usage of const Pin
HobbyProggy6-Jul-23 3:55
professionalHobbyProggy6-Jul-23 3:55 
QuestionMonospaced font (i.e. "Terminal" font in FontDialog Pin
Ronald Boucher14-Jun-23 12:53
Ronald Boucher14-Jun-23 12:53 
AnswerRe: Monospaced font (i.e. "Terminal" font in FontDialog Pin
Gerry Schmitz14-Jun-23 17:34
mveGerry Schmitz14-Jun-23 17:34 
AnswerRe: Monospaced font (i.e. "Terminal" font in FontDialog Pin
jschell15-Jun-23 2:47
jschell15-Jun-23 2:47 
AnswerRe: Monospaced font (i.e. "Terminal" font in FontDialog Pin
trønderen15-Jun-23 4:15
trønderen15-Jun-23 4:15 
AnswerRe: Monospaced font (i.e. "Terminal" font in FontDialog Pin
Dave Kreskowiak15-Jun-23 7:38
mveDave Kreskowiak15-Jun-23 7:38 
GeneralRe: Monospaced font (i.e. "Terminal" font in FontDialog Pin
Richard Andrew x6415-Jun-23 14:56
professionalRichard Andrew x6415-Jun-23 14:56 
GeneralRe: Monospaced font (i.e. "Terminal" font in FontDialog Pin
jschell16-Jun-23 9:58
jschell16-Jun-23 9:58 
GeneralRe: Monospaced font (i.e. "Terminal" font in FontDialog Pin
trønderen19-Jun-23 8:48
trønderen19-Jun-23 8:48 
QuestionReferencing an Array from another Class Pin
Member 1602947114-Jun-23 5:44
Member 1602947114-Jun-23 5:44 
Hi, I have the following get / set class,...


internal class PostSections
{
    public string title { get; set; }
    public string[] highlight { get; set; }
    public string[] highlight2 { get; set; }
    public bool highlightFirstWord { get; set; }
    public bool sendToValidation { get; set; }
    public string startDate { get; set; }
    public string endDate { get; set; }

    public Sectionquery[] sectionQueries { get; set; }
}

public class Sectionquery
{
    public string id { get; set; }
    public string name { get; set; }
    public string[] keywords { get; set; }
    public bool active { get; set; }

}


I can set the values for 'title', 'highlight' etc., but I cannot work out how to reference and set the values for items within the 'Sectionquery' class, eg: id, name, keywords and active.

Here's my code,...

var newPost = new PostSections()
     {
         title = "Title of Book",
         highlight = list.ToArray(),
         highlight2 = list.ToArray(),
         highlightFirstWord = false,
         sendToValidation = false,
         startDate = "2022-11-22T00:00:00.000Z",
         endDate = "2022-11-22T00:00:00.000Z",

         sectionQueries = new Sectionquery[] { }
     };


Using the above, my API call works, however I need to set values within that Sectionquery before calling the API. How to I reference them?

Hope my question's clear, thanks in advance.

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.