skip to Main Content

C# LINQ to select element from string array – Asp.net

I have a string: private const string Codes = "2,10"; public void method() { var displayCodes = Codes.Split(','); DemoResponse response = webService.GetResponse(); //getting response from API if(response.Errors.Any(x => displayCodes.Contains(x.StackTrace)) { int myCode = int.Parse(response.Errors.Select(x => x.StackTrace).FirstOrDefault()); } } This is…

VIEW QUESTION

Minimal API and XML formatters – Asp.net

Trying out minimal APIs in .NET 6 and can't make it work with XML content type. If I use standard controllers, using .AddXmlSerializerFormatters() extension does the job: builder.Services.AddControllers().AddXmlSerializerFormatters(); But when I switch from controller to .MapPost(..), I start getting 415…

VIEW QUESTION
Back To Top
Search