skip to Main Content

Json – Converting jarray to IEnumerable gives "does not contain a definition for Concat"

I've got the following code: using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; public class Program { public static void Main() { var json = JsonConvert.DeserializeObject<dynamic>("["test1", "test2"]"); var list = json.ToObject<IEnumerable<string>>().Concat(new[] { "test3" }); Console.WriteLine(string.Join(", ", list)); } } I…

VIEW QUESTION

Visual Studio Code – C# MAUI Async function catches for Windows but not for Android

I have the following code: public partial class MetricsPage : ContentPage { public MetricsPage() { InitializeComponent(); using var client = new HttpClient(); client.BaseAddress = new Uri("http://example.com"); client.Timeout = new TimeSpan(0, 0, 3); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Api-Key", "<my_key>"); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json"));…

VIEW QUESTION
Back To Top
Search