[{"data":1,"prerenderedAt":6127},["Reactive",2],{"navigation":3,"/posts/playing-with-dotnet8":204,"/posts/playing-with-dotnet8-surround":6094},[4,192,200],{"title":5,"_path":6,"children":7,"icon":191},"Blog","/posts",[8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,77,80,83,86,89,92,95,98,101,104,107,110,113,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188],{"title":9,"_path":10},"Testing your API with REST Client","/posts/testing-your-api-with-rest-client",{"title":12,"_path":13},"HTML templating in Xamarin","/posts/html-templating-in-xamarin",{"title":15,"_path":16},"Goodbye Azure Portal, Welcome Azure CLI","/posts/welcome-azure-cli",{"title":18,"_path":19},"Coming across Gitpod","/posts/gitpod",{"title":21,"_path":22},"Handle token retrieval while querying an API","/posts/delegating-handler",{"title":24,"_path":25},"Clean up your local git branches.","/posts/cleaning-git-branches",{"title":27,"_path":28},"Automate configuration of Teams Tab SSO with PowerShell.","/posts/teams-sso-powershell",{"title":30,"_path":31},"How to do a technology watch? - Part 1","/posts/technology-watch-part1",{"title":33,"_path":34},"How to do a technology watch? - Part 2","/posts/technology-watch-part2",{"title":36,"_path":37},"You almost no longer need Key Vault references for Azure Functions.","/posts/azure-functions-custom-configuration",{"title":39,"_path":40},"How to do a technology watch? - Part 3","/posts/technology-watch-part3",{"title":42,"_path":43},"Forget DevOps, the future is already here!","/posts/devops-future",{"title":45,"_path":46},"Week 9, 2021 - Tips I learned this week","/posts/w09-2021-tips-learned-this-week",{"title":48,"_path":49},"Week 12, 2021 - Tips I learned this week","/posts/w12-2021-tips-learned-this-week",{"title":51,"_path":52},"Week 14, 2021 - Tips I learned this week","/posts/w14-2021-tips-learned-this-week",{"title":54,"_path":55},"Once upon a time in .NET","/posts/once-upon-a-time-in-dotnet",{"title":57,"_path":58},"Install your applications with winget","/posts/winget-import",{"title":60,"_path":61},"Customize your applications when installing them with winget","/posts/winget-override",{"title":63,"_path":64},"Week 22, 2021 - Tips I learned this week","/posts/w22-2021-tips-learned-this-week",{"title":66,"_path":67},"How to connect to an Azure SQL Database from C# using Azure AD","/posts/sqlclient-active-directory-authent",{"title":69,"_path":70},"Producing packages for Windows Package Manager","/posts/wingetcreate",{"title":72,"_path":73},"4 tips about GitHub Actions environment variables and contexts","/posts/github-actions-var-and-context",{"title":75,"_path":76},"AzureWebJobsStorage, the secret you don't need in your Function App.","/posts/azure-functions-without-azurewebjobsstorage",{"title":78,"_path":79},"ASP.NET Core - Lost in configuration","/posts/lost-in-configuration",{"title":81,"_path":82},"Week 39, 2021 - Tips I learned this week","/posts/w39-2021-tips-learned-this-week",{"title":84,"_path":85},"Week 41, 2021 - Tips I learned this week","/posts/w41-2021-tips-learned-this-week",{"title":87,"_path":88},"Migrating and open-sourcing my blog","/posts/migrating-blog",{"title":90,"_path":91},"Week 45, 2021 - Tips I learned this week","/posts/w45-2021-tips-learned-this-week",{"title":93,"_path":94},"Organize your GitHub stars with Astral","/posts/astral",{"title":96,"_path":97},"Pulumi with an Azure Blob Storage backend","/posts/pulumi-azure-backend",{"title":99,"_path":100},"IaC Hot Reload with Pulumi Watch","/posts/pulumi-watch",{"title":102,"_path":103},"Week 2, 2022 - Tips I learned this week","/posts/w02-2022-tips-learned-this-week",{"title":105,"_path":106},"Week 3, 2022 - Tips I learned this week","/posts/w03-2022-tips-learned-this-week",{"title":108,"_path":109},"Week 5, 2022 - Tips I learned this week","/posts/w05-2022-tips-learned-this-week",{"title":111,"_path":112},"How to provision an Azure SQL Database with Active Directory authentication","/posts/sqldatabase-active-directory-authent",{"title":114,"_path":115},"Why will I choose Pulumi over Terraform for my next project?","/posts/pulumi-vs-terraform",{"title":117,"_path":118},"Week 19, 2022 - Tips I learned this week","/posts/w19-2022-tips-learned-this-week",{"title":120,"_path":121},"Week 20, 2022 - Tips I learned this week","/posts/w20-2022-tips-learned-this-week",{"title":123,"_path":124},"Keeping secrets secure when using API Clients","/posts/http-clients-secrets",{"title":126,"_path":127},"What made me want to be a developer?","/posts/be-a-developer",{"title":129,"_path":130},"What can we do when stuck with a programming problem?","/posts/get-unstuck",{"title":132,"_path":133},"How did I automate the setup of my developer Windows laptop?","/posts/automate-developer-machine",{"title":135,"_path":136},"Discussion about API clients","/posts/http-clients",{"title":138,"_path":139},"Week 46, 2022 - Tips I learned this week","/posts/w46-2022-tips-learned-this-week",{"title":141,"_path":142},"When Pulumi met Nuke: a .NET love story","/posts/when-pulumi-met-nuke",{"title":144,"_path":145},"A year of learning and sharing - Dev Retro 2022","/posts/2022-retro",{"title":147,"_path":148},"Perform Dynamic Execution of an npm Package","/posts/pnpm-dlx",{"title":150,"_path":151},"Manage multiple Node.js versions","/posts/pnpm-env",{"title":153,"_path":154},"Introducing the Vue.js CI/CD series","/posts/vuecicd-introduction",{"title":156,"_path":157},"Execute commands using your project dependencies","/posts/pnpm-exec",{"title":159,"_path":160},"Vue.js CI/CD: Continuous Integration","/posts/vuecicd-ci",{"title":162,"_path":163},"Who is using pnpm?","/posts/pnpm-who-is-using",{"title":165,"_path":166},"Create an Azure-Ready GitHub Repository using Pulumi","/posts/azure-ready-github-repository",{"title":168,"_path":169},"Deploying to Azure from Azure DevOps without secrets","/posts/ado-workload-identity-federation",{"title":171,"_path":172},"Effortlessly Configure GitHub Repositories for Azure Deployment via OIDC","/posts/scripting-azure-ready-github-repository",{"title":174,"_path":175},"Playing with the .NET 8 Web API template","/posts/playing-with-dotnet8",{"title":177,"_path":178},"Another year of sharing and learning - Dev Retro 2023","/posts/2023-retro",{"title":180,"_path":181},"Week 4, 2024 - Tips I learned this week","/posts/w04-2024-tips-learned-this-week",{"title":183,"_path":184},"Using dependency injection with Azure .NET SDK","/posts/azure-sdk-di",{"title":186,"_path":187},"Having Fun With IT Event Calendars","/posts/it-event-calendars",{"title":189,"_path":190},"Call your Azure AD B2C protected API with authenticated HTTP requests from your JetBrains IDE","/posts/http-clients-oauth2","i-heroicons-newspaper",{"title":193,"_path":194,"children":195,"icon":199},"Goodies","/goodies",[196],{"title":197,"_path":198},"My Git Cheat Sheet","/goodies/gitcheatsheet","i-heroicons-gift-solid",{"title":201,"_path":202,"icon":203},"About","/about","i-heroicons-user-circle-solid",{"_path":175,"_dir":205,"_draft":206,"_partial":206,"_locale":207,"title":174,"description":208,"lead":209,"date":210,"image":211,"badge":213,"tags":215,"body":221,"_type":6089,"_id":6090,"_source":6091,"_file":6092,"_extension":6093},"posts",false,"","In this article, we will explore the latest C# 12 and .NET 8 features by applying them to the basic dotnet Web API template.","Enhanced weather forecast API","2023-12-19T00:00:00.000Z",{"src":212},"/images/weather_flag.webp",{"label":214},"Development",[216,217,218,219,220],"csharp",".NET","ASP.NET Core","HTTP","advent",{"type":222,"children":223,"toc":6084},"root",[224,231,238,254,294,299,311,316,351,366,375,388,460,482,499,519,528,534,539,544,588,597,610,1007,1035,1194,1206,1235,2406,2411,2567,2588,3109,3119,3336,3350,3554,3559,3822,3827,3838,4164,4173,4186,4418,4446,4451,4583,4588,4723,4736,5063,5075,5098,5405,5425,5839,5845,5850,5852,6014,6042,6064,6078],{"type":225,"tag":226,"props":227,"children":228},"element","p",{},[229],{"type":230,"value":208},"text",{"type":225,"tag":232,"props":233,"children":235},"h2",{"id":234},"getting-started-with-the-aspnet-core-web-api-template",[236],{"type":230,"value":237},"Getting started with the ASP.NET Core Web API template",{"type":225,"tag":226,"props":239,"children":240},{},[241,243,252],{"type":230,"value":242},"First, let's install the latest ",{"type":225,"tag":244,"props":245,"children":249},"a",{"href":246,"rel":247},"https://dotnet.microsoft.com/en-us/download/dotnet/8.0",[248],"nofollow",[250],{"type":230,"value":251},".NET 8 SDK",{"type":230,"value":253},":",{"type":225,"tag":255,"props":256,"children":260},"pre",{"className":257,"code":258,"language":259,"meta":207,"style":207},"language-powershell shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","winget install --id Microsoft.DotNet.SDK.8\n","powershell",[261],{"type":225,"tag":262,"props":263,"children":264},"code",{"__ignoreMap":207},[265],{"type":225,"tag":266,"props":267,"children":270},"span",{"class":268,"line":269},"line",1,[271,277,283,288],{"type":225,"tag":266,"props":272,"children":274},{"style":273},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[275],{"type":230,"value":276},"winget install ",{"type":225,"tag":266,"props":278,"children":280},{"style":279},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[281],{"type":230,"value":282},"--",{"type":225,"tag":266,"props":284,"children":285},{"style":273},[286],{"type":230,"value":287},"id Microsoft.DotNet.SDK.",{"type":225,"tag":266,"props":289,"children":291},{"style":290},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[292],{"type":230,"value":293},"8\n",{"type":225,"tag":226,"props":295,"children":296},{},[297],{"type":230,"value":298},"We can list the available templates:",{"type":225,"tag":226,"props":300,"children":301},{},[302],{"type":225,"tag":303,"props":304,"children":310},"img",{"alt":305,"className":306,"src":309},"List of the available dotnet templates",[307,308],"rounded-lg","mx-auto","/posts/images/dontnet8_templates.webp",[],{"type":225,"tag":226,"props":312,"children":313},{},[314],{"type":230,"value":315},"Let's go for the basic ASP.NET Core Web API template but with the controllers:",{"type":225,"tag":255,"props":317,"children":319},{"className":257,"code":318,"language":259,"meta":207,"style":207},"dotnet new webapi --use-controllers -n WeatherApi\n",[320],{"type":225,"tag":262,"props":321,"children":322},{"__ignoreMap":207},[323],{"type":225,"tag":266,"props":324,"children":325},{"class":268,"line":269},[326,331,335,341,346],{"type":225,"tag":266,"props":327,"children":328},{"style":273},[329],{"type":230,"value":330},"dotnet new webapi ",{"type":225,"tag":266,"props":332,"children":333},{"style":279},[334],{"type":230,"value":282},{"type":225,"tag":266,"props":336,"children":338},{"style":337},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[339],{"type":230,"value":340},"use-controllers",{"type":225,"tag":266,"props":342,"children":343},{"style":279},[344],{"type":230,"value":345}," -",{"type":225,"tag":266,"props":347,"children":348},{"style":273},[349],{"type":230,"value":350},"n WeatherApi\n",{"type":225,"tag":352,"props":353,"children":355},"callout",{"icon":354},"i-heroicons-light-bulb",[356],{"type":225,"tag":226,"props":357,"children":358},{},[359,364],{"type":225,"tag":266,"props":360,"children":361},{},[362],{"type":230,"value":363},"Minimal APIs",{"type":230,"value":365}," are great too but having controllers is more suited to what I want to show in this article.",{"type":225,"tag":226,"props":367,"children":368},{},[369],{"type":225,"tag":303,"props":370,"children":374},{"alt":371,"className":372,"src":373},"Screenshot of the generated project in Rider",[307,308],"/posts/images/dontnet8_webapi_template.webp",[],{"type":225,"tag":226,"props":376,"children":377},{},[378,380,386],{"type":230,"value":379},"We can run the API and test the ",{"type":225,"tag":262,"props":381,"children":383},{"className":382},[],[384],{"type":230,"value":385},"GET /weatherforecast",{"type":230,"value":387}," endpoint using the generated request file:",{"type":225,"tag":255,"props":389,"children":393},{"className":390,"code":391,"language":392,"meta":207,"style":207},"language-http shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","@WeatherApi_HostAddress = http://localhost:5103\n\nGET {{WeatherApi_HostAddress}}/weatherforecast/\nAccept: application/json\n","http",[394],{"type":225,"tag":262,"props":395,"children":396},{"__ignoreMap":207},[397,416,426,441],{"type":225,"tag":266,"props":398,"children":399},{"class":268,"line":269},[400,405,410],{"type":225,"tag":266,"props":401,"children":402},{"style":290},[403],{"type":230,"value":404},"@",{"type":225,"tag":266,"props":406,"children":407},{"style":273},[408],{"type":230,"value":409},"WeatherApi_HostAddress = ",{"type":225,"tag":266,"props":411,"children":413},{"style":412},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[414],{"type":230,"value":415},"http://localhost:5103\n",{"type":225,"tag":266,"props":417,"children":419},{"class":268,"line":418},2,[420],{"type":225,"tag":266,"props":421,"children":423},{"emptyLinePlaceholder":422},true,[424],{"type":230,"value":425},"\n",{"type":225,"tag":266,"props":427,"children":429},{"class":268,"line":428},3,[430,436],{"type":225,"tag":266,"props":431,"children":433},{"style":432},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF;--shiki-light-font-style:italic;--shiki-default-font-style:italic;--shiki-dark-font-style:italic",[434],{"type":230,"value":435},"GET",{"type":225,"tag":266,"props":437,"children":438},{"style":273},[439],{"type":230,"value":440}," {{WeatherApi_HostAddress}}/weatherforecast/\n",{"type":225,"tag":266,"props":442,"children":444},{"class":268,"line":443},4,[445,451,455],{"type":225,"tag":266,"props":446,"children":448},{"style":447},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[449],{"type":230,"value":450},"Accept",{"type":225,"tag":266,"props":452,"children":453},{"style":290},[454],{"type":230,"value":253},{"type":225,"tag":266,"props":456,"children":457},{"style":412},[458],{"type":230,"value":459}," application/json\n",{"type":225,"tag":226,"props":461,"children":462},{},[463,465,471,473,480],{"type":230,"value":464},"This is included in the dotnet ",{"type":225,"tag":262,"props":466,"children":468},{"className":467},[],[469],{"type":230,"value":470},"webapi",{"type":230,"value":472}," template and is supported by Visual Studio, Rider, and vscode (using the ",{"type":225,"tag":244,"props":474,"children":477},{"href":475,"rel":476},"https://marketplace.visualstudio.com/items?itemName=humao.rest-client",[248],[478],{"type":230,"value":479},"REST Client extension",{"type":230,"value":481},")",{"type":225,"tag":352,"props":483,"children":484},{"icon":354},[485],{"type":225,"tag":226,"props":486,"children":487},{},[488,490,497],{"type":230,"value":489},"Read my article about ",{"type":225,"tag":244,"props":491,"children":494},{"href":492,"rel":493},"https://www.techwatching.dev/posts/http-clients",[248],[495],{"type":230,"value":496},"choosing an API Client",{"type":230,"value":498}," and why I prefer versioned HTTP files rather than GUI tools like Postman.",{"type":225,"tag":226,"props":500,"children":501},{},[502,504,517],{"type":230,"value":503},"If we put a breakpoint in the controller we can see one small ASP.NET 8 improvement concerning the debugging experience: ",{"type":225,"tag":244,"props":505,"children":508},{"href":506,"rel":507},"https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-8.0?view=aspnetcore-8.0#improved-debugging-experience",[248],[509,511],{"type":230,"value":510},"better debug summaries are displayed for types like ",{"type":225,"tag":262,"props":512,"children":514},{"className":513},[],[515],{"type":230,"value":516},"HttpContext",{"type":230,"value":518},".",{"type":225,"tag":226,"props":520,"children":521},{},[522],{"type":225,"tag":303,"props":523,"children":527},{"alt":524,"className":525,"src":526},"Debugging display of the HTTPContext class",[307,308],"/posts/images/dontnet8_httpcontext.webp",[],{"type":225,"tag":232,"props":529,"children":531},{"id":530},"enhancing-the-weather-forecast-api",[532],{"type":230,"value":533},"Enhancing the Weather Forecast API",{"type":225,"tag":226,"props":535,"children":536},{},[537],{"type":230,"value":538},"Currently, the template randomly generates weather forecasts in the controller. It would be nice to retrieve real weather data from a weather API.",{"type":225,"tag":226,"props":540,"children":541},{},[542],{"type":230,"value":543},"To do that we can:",{"type":225,"tag":545,"props":546,"children":547},"ul",{},[548,562,575],{"type":225,"tag":549,"props":550,"children":551},"li",{},[552,554,560],{"type":230,"value":553},"introduce an ",{"type":225,"tag":262,"props":555,"children":557},{"className":556},[],[558],{"type":230,"value":559},"IWeatherService",{"type":230,"value":561}," interface that contains a method to retrieve weather forecasts",{"type":225,"tag":549,"props":563,"children":564},{},[565,567,573],{"type":230,"value":566},"extract the current logic that generates the random weather forecasts in a ",{"type":225,"tag":262,"props":568,"children":570},{"className":569},[],[571],{"type":230,"value":572},"RandomWeatherService.cs",{"type":230,"value":574}," that implements this interface",{"type":225,"tag":549,"props":576,"children":577},{},[578,580,586],{"type":230,"value":579},"creates a new implementation ",{"type":225,"tag":262,"props":581,"children":583},{"className":582},[],[584],{"type":230,"value":585},"OpenWeatherService",{"type":230,"value":587}," of this interface that retrieves the weather data from the Open Weather Map API",{"type":225,"tag":226,"props":589,"children":590},{},[591],{"type":225,"tag":303,"props":592,"children":596},{"alt":593,"className":594,"src":595},"A diagram of the ASP.NETCore Weather API",[307,308],"/posts/images/dontnet8_webapi_diagram.webp",[],{"type":225,"tag":226,"props":598,"children":599},{},[600,602,608],{"type":230,"value":601},"The ",{"type":225,"tag":262,"props":603,"children":605},{"className":604},[],[606],{"type":230,"value":607},"WeatherForecastController",{"type":230,"value":609}," becomes:",{"type":225,"tag":255,"props":611,"children":614},{"className":612,"code":613,"language":216,"meta":207,"style":207},"language-csharp shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[ApiController]\n[Route(\"[controller]\")]\npublic class WeatherForecastController : ControllerBase\n{\n    private readonly IWeatherService _weatherService;\n\n    public WeatherForecastController(IWeatherService weatherService)\n    {\n        _weatherService = weatherService;\n    }\n\n    [HttpGet(Name = \"GetWeatherForecast\")]\n    [ProducesResponseType(typeof(WeatherForecast), StatusCodes.Status200OK)]\n    public Task\u003CWeatherForecast[]> Get()\n    {\n        return _weatherService.GetWeatherForecasts();\n    }\n}\n",[615],{"type":225,"tag":262,"props":616,"children":617},{"__ignoreMap":207},[618,637,673,702,710,739,747,778,787,809,818,826,872,918,955,963,990,998],{"type":225,"tag":266,"props":619,"children":620},{"class":268,"line":269},[621,626,632],{"type":225,"tag":266,"props":622,"children":623},{"style":279},[624],{"type":230,"value":625},"[",{"type":225,"tag":266,"props":627,"children":629},{"style":628},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[630],{"type":230,"value":631},"ApiController",{"type":225,"tag":266,"props":633,"children":634},{"style":279},[635],{"type":230,"value":636},"]\n",{"type":225,"tag":266,"props":638,"children":639},{"class":268,"line":418},[640,644,649,654,659,664,668],{"type":225,"tag":266,"props":641,"children":642},{"style":279},[643],{"type":230,"value":625},{"type":225,"tag":266,"props":645,"children":646},{"style":628},[647],{"type":230,"value":648},"Route",{"type":225,"tag":266,"props":650,"children":651},{"style":279},[652],{"type":230,"value":653},"(",{"type":225,"tag":266,"props":655,"children":656},{"style":279},[657],{"type":230,"value":658},"\"",{"type":225,"tag":266,"props":660,"children":661},{"style":412},[662],{"type":230,"value":663},"[controller]",{"type":225,"tag":266,"props":665,"children":666},{"style":279},[667],{"type":230,"value":658},{"type":225,"tag":266,"props":669,"children":670},{"style":279},[671],{"type":230,"value":672},")]\n",{"type":225,"tag":266,"props":674,"children":675},{"class":268,"line":428},[676,682,687,692,697],{"type":225,"tag":266,"props":677,"children":679},{"style":678},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[680],{"type":230,"value":681},"public",{"type":225,"tag":266,"props":683,"children":684},{"style":628},[685],{"type":230,"value":686}," class",{"type":225,"tag":266,"props":688,"children":689},{"style":628},[690],{"type":230,"value":691}," WeatherForecastController",{"type":225,"tag":266,"props":693,"children":694},{"style":279},[695],{"type":230,"value":696}," :",{"type":225,"tag":266,"props":698,"children":699},{"style":628},[700],{"type":230,"value":701}," ControllerBase\n",{"type":225,"tag":266,"props":703,"children":704},{"class":268,"line":443},[705],{"type":225,"tag":266,"props":706,"children":707},{"style":279},[708],{"type":230,"value":709},"{\n",{"type":225,"tag":266,"props":711,"children":713},{"class":268,"line":712},5,[714,719,724,729,734],{"type":225,"tag":266,"props":715,"children":716},{"style":678},[717],{"type":230,"value":718},"    private",{"type":225,"tag":266,"props":720,"children":721},{"style":678},[722],{"type":230,"value":723}," readonly",{"type":225,"tag":266,"props":725,"children":726},{"style":628},[727],{"type":230,"value":728}," IWeatherService",{"type":225,"tag":266,"props":730,"children":731},{"style":628},[732],{"type":230,"value":733}," _weatherService",{"type":225,"tag":266,"props":735,"children":736},{"style":279},[737],{"type":230,"value":738},";\n",{"type":225,"tag":266,"props":740,"children":742},{"class":268,"line":741},6,[743],{"type":225,"tag":266,"props":744,"children":745},{"emptyLinePlaceholder":422},[746],{"type":230,"value":425},{"type":225,"tag":266,"props":748,"children":750},{"class":268,"line":749},7,[751,756,760,764,768,773],{"type":225,"tag":266,"props":752,"children":753},{"style":678},[754],{"type":230,"value":755},"    public",{"type":225,"tag":266,"props":757,"children":758},{"style":337},[759],{"type":230,"value":691},{"type":225,"tag":266,"props":761,"children":762},{"style":279},[763],{"type":230,"value":653},{"type":225,"tag":266,"props":765,"children":766},{"style":628},[767],{"type":230,"value":559},{"type":225,"tag":266,"props":769,"children":770},{"style":628},[771],{"type":230,"value":772}," weatherService",{"type":225,"tag":266,"props":774,"children":775},{"style":279},[776],{"type":230,"value":777},")\n",{"type":225,"tag":266,"props":779,"children":781},{"class":268,"line":780},8,[782],{"type":225,"tag":266,"props":783,"children":784},{"style":279},[785],{"type":230,"value":786},"    {\n",{"type":225,"tag":266,"props":788,"children":790},{"class":268,"line":789},9,[791,796,801,805],{"type":225,"tag":266,"props":792,"children":793},{"style":273},[794],{"type":230,"value":795},"        _weatherService ",{"type":225,"tag":266,"props":797,"children":798},{"style":279},[799],{"type":230,"value":800},"=",{"type":225,"tag":266,"props":802,"children":803},{"style":273},[804],{"type":230,"value":772},{"type":225,"tag":266,"props":806,"children":807},{"style":279},[808],{"type":230,"value":738},{"type":225,"tag":266,"props":810,"children":812},{"class":268,"line":811},10,[813],{"type":225,"tag":266,"props":814,"children":815},{"style":279},[816],{"type":230,"value":817},"    }\n",{"type":225,"tag":266,"props":819,"children":821},{"class":268,"line":820},11,[822],{"type":225,"tag":266,"props":823,"children":824},{"emptyLinePlaceholder":422},[825],{"type":230,"value":425},{"type":225,"tag":266,"props":827,"children":829},{"class":268,"line":828},12,[830,835,840,844,849,854,859,864,868],{"type":225,"tag":266,"props":831,"children":832},{"style":279},[833],{"type":230,"value":834},"    [",{"type":225,"tag":266,"props":836,"children":837},{"style":628},[838],{"type":230,"value":839},"HttpGet",{"type":225,"tag":266,"props":841,"children":842},{"style":279},[843],{"type":230,"value":653},{"type":225,"tag":266,"props":845,"children":846},{"style":628},[847],{"type":230,"value":848},"Name",{"type":225,"tag":266,"props":850,"children":851},{"style":279},[852],{"type":230,"value":853}," =",{"type":225,"tag":266,"props":855,"children":856},{"style":279},[857],{"type":230,"value":858}," \"",{"type":225,"tag":266,"props":860,"children":861},{"style":412},[862],{"type":230,"value":863},"GetWeatherForecast",{"type":225,"tag":266,"props":865,"children":866},{"style":279},[867],{"type":230,"value":658},{"type":225,"tag":266,"props":869,"children":870},{"style":279},[871],{"type":230,"value":672},{"type":225,"tag":266,"props":873,"children":875},{"class":268,"line":874},13,[876,880,885,890,895,900,905,909,914],{"type":225,"tag":266,"props":877,"children":878},{"style":279},[879],{"type":230,"value":834},{"type":225,"tag":266,"props":881,"children":882},{"style":628},[883],{"type":230,"value":884},"ProducesResponseType",{"type":225,"tag":266,"props":886,"children":887},{"style":279},[888],{"type":230,"value":889},"(typeof(",{"type":225,"tag":266,"props":891,"children":892},{"style":628},[893],{"type":230,"value":894},"WeatherForecast",{"type":225,"tag":266,"props":896,"children":897},{"style":279},[898],{"type":230,"value":899},"),",{"type":225,"tag":266,"props":901,"children":902},{"style":273},[903],{"type":230,"value":904}," StatusCodes",{"type":225,"tag":266,"props":906,"children":907},{"style":279},[908],{"type":230,"value":518},{"type":225,"tag":266,"props":910,"children":911},{"style":273},[912],{"type":230,"value":913},"Status200OK",{"type":225,"tag":266,"props":915,"children":916},{"style":279},[917],{"type":230,"value":672},{"type":225,"tag":266,"props":919,"children":921},{"class":268,"line":920},14,[922,926,931,936,940,945,950],{"type":225,"tag":266,"props":923,"children":924},{"style":678},[925],{"type":230,"value":755},{"type":225,"tag":266,"props":927,"children":928},{"style":628},[929],{"type":230,"value":930}," Task",{"type":225,"tag":266,"props":932,"children":933},{"style":279},[934],{"type":230,"value":935},"\u003C",{"type":225,"tag":266,"props":937,"children":938},{"style":628},[939],{"type":230,"value":894},{"type":225,"tag":266,"props":941,"children":942},{"style":279},[943],{"type":230,"value":944},"[]>",{"type":225,"tag":266,"props":946,"children":947},{"style":337},[948],{"type":230,"value":949}," Get",{"type":225,"tag":266,"props":951,"children":952},{"style":279},[953],{"type":230,"value":954},"()\n",{"type":225,"tag":266,"props":956,"children":958},{"class":268,"line":957},15,[959],{"type":225,"tag":266,"props":960,"children":961},{"style":279},[962],{"type":230,"value":786},{"type":225,"tag":266,"props":964,"children":966},{"class":268,"line":965},16,[967,972,976,980,985],{"type":225,"tag":266,"props":968,"children":969},{"style":432},[970],{"type":230,"value":971},"        return",{"type":225,"tag":266,"props":973,"children":974},{"style":273},[975],{"type":230,"value":733},{"type":225,"tag":266,"props":977,"children":978},{"style":279},[979],{"type":230,"value":518},{"type":225,"tag":266,"props":981,"children":982},{"style":337},[983],{"type":230,"value":984},"GetWeatherForecasts",{"type":225,"tag":266,"props":986,"children":987},{"style":279},[988],{"type":230,"value":989},"();\n",{"type":225,"tag":266,"props":991,"children":993},{"class":268,"line":992},17,[994],{"type":225,"tag":266,"props":995,"children":996},{"style":279},[997],{"type":230,"value":817},{"type":225,"tag":266,"props":999,"children":1001},{"class":268,"line":1000},18,[1002],{"type":225,"tag":266,"props":1003,"children":1004},{"style":279},[1005],{"type":230,"value":1006},"}\n",{"type":225,"tag":226,"props":1008,"children":1009},{},[1010,1012,1018,1020,1027,1029],{"type":230,"value":1011},"We can get rid of the ",{"type":225,"tag":262,"props":1013,"children":1015},{"className":1014},[],[1016],{"type":230,"value":1017},"typeof",{"type":230,"value":1019}," because there are now ",{"type":225,"tag":244,"props":1021,"children":1024},{"href":1022,"rel":1023},"https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-8.0?view=aspnetcore-8.0#support-for-generic-attributes",[248],[1025],{"type":230,"value":1026},"generic attributes for some common ASP.NET Core attributes",{"type":230,"value":1028}," like ",{"type":225,"tag":262,"props":1030,"children":1032},{"className":1031},[],[1033],{"type":230,"value":1034},"ProducesResponseType.",{"type":225,"tag":255,"props":1036,"children":1038},{"className":612,"code":1037,"language":216,"meta":207,"style":207},"    [HttpGet(Name = \"GetWeatherForecast\")]\n    [ProducesResponseType\u003CWeatherForecast>(StatusCodes.Status200OK)]\n    public Task\u003CWeatherForecast[]> Get()\n    {\n        return _weatherService.GetWeatherForecasts();\n    }\n",[1039],{"type":225,"tag":262,"props":1040,"children":1041},{"__ignoreMap":207},[1042,1081,1126,1157,1164,1187],{"type":225,"tag":266,"props":1043,"children":1044},{"class":268,"line":269},[1045,1049,1053,1057,1061,1065,1069,1073,1077],{"type":225,"tag":266,"props":1046,"children":1047},{"style":279},[1048],{"type":230,"value":834},{"type":225,"tag":266,"props":1050,"children":1051},{"style":628},[1052],{"type":230,"value":839},{"type":225,"tag":266,"props":1054,"children":1055},{"style":279},[1056],{"type":230,"value":653},{"type":225,"tag":266,"props":1058,"children":1059},{"style":628},[1060],{"type":230,"value":848},{"type":225,"tag":266,"props":1062,"children":1063},{"style":279},[1064],{"type":230,"value":853},{"type":225,"tag":266,"props":1066,"children":1067},{"style":279},[1068],{"type":230,"value":858},{"type":225,"tag":266,"props":1070,"children":1071},{"style":412},[1072],{"type":230,"value":863},{"type":225,"tag":266,"props":1074,"children":1075},{"style":279},[1076],{"type":230,"value":658},{"type":225,"tag":266,"props":1078,"children":1079},{"style":279},[1080],{"type":230,"value":672},{"type":225,"tag":266,"props":1082,"children":1083},{"class":268,"line":418},[1084,1088,1092,1096,1100,1105,1109,1114,1118,1122],{"type":225,"tag":266,"props":1085,"children":1086},{"style":279},[1087],{"type":230,"value":834},{"type":225,"tag":266,"props":1089,"children":1090},{"style":628},[1091],{"type":230,"value":884},{"type":225,"tag":266,"props":1093,"children":1094},{"style":273},[1095],{"type":230,"value":935},{"type":225,"tag":266,"props":1097,"children":1098},{"style":628},[1099],{"type":230,"value":894},{"type":225,"tag":266,"props":1101,"children":1102},{"style":273},[1103],{"type":230,"value":1104},">",{"type":225,"tag":266,"props":1106,"children":1107},{"style":279},[1108],{"type":230,"value":653},{"type":225,"tag":266,"props":1110,"children":1111},{"style":273},[1112],{"type":230,"value":1113},"StatusCodes",{"type":225,"tag":266,"props":1115,"children":1116},{"style":279},[1117],{"type":230,"value":518},{"type":225,"tag":266,"props":1119,"children":1120},{"style":273},[1121],{"type":230,"value":913},{"type":225,"tag":266,"props":1123,"children":1124},{"style":279},[1125],{"type":230,"value":672},{"type":225,"tag":266,"props":1127,"children":1128},{"class":268,"line":428},[1129,1133,1137,1141,1145,1149,1153],{"type":225,"tag":266,"props":1130,"children":1131},{"style":678},[1132],{"type":230,"value":755},{"type":225,"tag":266,"props":1134,"children":1135},{"style":628},[1136],{"type":230,"value":930},{"type":225,"tag":266,"props":1138,"children":1139},{"style":279},[1140],{"type":230,"value":935},{"type":225,"tag":266,"props":1142,"children":1143},{"style":628},[1144],{"type":230,"value":894},{"type":225,"tag":266,"props":1146,"children":1147},{"style":279},[1148],{"type":230,"value":944},{"type":225,"tag":266,"props":1150,"children":1151},{"style":337},[1152],{"type":230,"value":949},{"type":225,"tag":266,"props":1154,"children":1155},{"style":279},[1156],{"type":230,"value":954},{"type":225,"tag":266,"props":1158,"children":1159},{"class":268,"line":443},[1160],{"type":225,"tag":266,"props":1161,"children":1162},{"style":279},[1163],{"type":230,"value":786},{"type":225,"tag":266,"props":1165,"children":1166},{"class":268,"line":712},[1167,1171,1175,1179,1183],{"type":225,"tag":266,"props":1168,"children":1169},{"style":432},[1170],{"type":230,"value":971},{"type":225,"tag":266,"props":1172,"children":1173},{"style":273},[1174],{"type":230,"value":733},{"type":225,"tag":266,"props":1176,"children":1177},{"style":279},[1178],{"type":230,"value":518},{"type":225,"tag":266,"props":1180,"children":1181},{"style":337},[1182],{"type":230,"value":984},{"type":225,"tag":266,"props":1184,"children":1185},{"style":279},[1186],{"type":230,"value":989},{"type":225,"tag":266,"props":1188,"children":1189},{"class":268,"line":741},[1190],{"type":225,"tag":266,"props":1191,"children":1192},{"style":279},[1193],{"type":230,"value":817},{"type":225,"tag":226,"props":1195,"children":1196},{},[1197,1199,1204],{"type":230,"value":1198},"There are now 2 implementations of the ",{"type":225,"tag":262,"props":1200,"children":1202},{"className":1201},[],[1203],{"type":230,"value":559},{"type":230,"value":1205}," interface:",{"type":225,"tag":545,"props":1207,"children":1208},{},[1209,1220],{"type":225,"tag":549,"props":1210,"children":1211},{},[1212,1218],{"type":225,"tag":262,"props":1213,"children":1215},{"className":1214},[],[1216],{"type":230,"value":1217},"RandomWeatherService",{"type":230,"value":1219}," that contains the code that previously was in the controller",{"type":225,"tag":549,"props":1221,"children":1222},{},[1223,1228,1230],{"type":225,"tag":262,"props":1224,"children":1226},{"className":1225},[],[1227],{"type":230,"value":585},{"type":230,"value":1229}," that makes a call to the Open Weather Map API to retrieve the weather forecasts and then maps the obtained data to a list of ",{"type":225,"tag":262,"props":1231,"children":1233},{"className":1232},[],[1234],{"type":230,"value":894},{"type":225,"tag":255,"props":1236,"children":1238},{"className":612,"code":1237,"language":216,"meta":207,"style":207},"public class OpenWeatherService : IWeatherService\n{\n    private readonly IOpenWeatherMapApi _openWeatherMapApi;\n    private static readonly (double Latitude, double Longitude) BordeauxCoordinates = (44.837789, -0.57918);\n\n    public OpenWeatherService(IOpenWeatherMapApi openWeatherMapApi)\n    {\n        _openWeatherMapApi = openWeatherMapApi;\n    }\n\n    public async Task\u003CWeatherForecast[]> GetWeatherForecasts()\n    {\n        var weatherApiResponse = await _openWeatherMapApi.GetWeatherForecast(BordeauxCoordinates.Latitude, BordeauxCoordinates.Longitude);\n        \n        var computeWeatherSummary = (double temperature) =>\n            temperature switch\n            {\n                \u003C 0 => \"Freezing\",\n                >= 0 and \u003C 5 => \"Bracing\",\n                >= 5 and \u003C 12 => \"Chilly\",\n                >= 12 and \u003C 18 => \"Cool\",\n                >= 18 and \u003C 24 => \"Mild\",\n                >= 24 and \u003C 30 => \"Warm\",\n                >= 30 and \u003C 35 => \"Balmy\",\n                >= 35 and \u003C 40 => \"Hot\",\n                >= 40 and \u003C 45 => \"Sweltering\",\n                >= 45 => \"Scorching\",\n                _ => \"Warm\"\n            };\n        return weatherApiResponse.List\n            .Select(x =>\n                new WeatherForecast\n                {\n                    Date = DateOnly.FromDateTime(DateTimeOffset.FromUnixTimeSeconds(x.Dt).Date),\n                    TemperatureC = Convert.ToInt32(x.Main.Temp),\n                    Summary = computeWeatherSummary(x.Main.Temp)\n                })\n            .ToArray();\n    }\n}\n",[1239],{"type":225,"tag":262,"props":1240,"children":1241},{"__ignoreMap":207},[1242,1267,1274,1299,1381,1388,1417,1424,1444,1451,1458,1495,1502,1575,1583,1617,1630,1638,1674,1723,1769,1815,1861,1907,1953,1999,2045,2078,2105,2114,2135,2162,2176,2185,2262,2319,2364,2373,2390,2398],{"type":225,"tag":266,"props":1243,"children":1244},{"class":268,"line":269},[1245,1249,1253,1258,1262],{"type":225,"tag":266,"props":1246,"children":1247},{"style":678},[1248],{"type":230,"value":681},{"type":225,"tag":266,"props":1250,"children":1251},{"style":628},[1252],{"type":230,"value":686},{"type":225,"tag":266,"props":1254,"children":1255},{"style":628},[1256],{"type":230,"value":1257}," OpenWeatherService",{"type":225,"tag":266,"props":1259,"children":1260},{"style":279},[1261],{"type":230,"value":696},{"type":225,"tag":266,"props":1263,"children":1264},{"style":628},[1265],{"type":230,"value":1266}," IWeatherService\n",{"type":225,"tag":266,"props":1268,"children":1269},{"class":268,"line":418},[1270],{"type":225,"tag":266,"props":1271,"children":1272},{"style":279},[1273],{"type":230,"value":709},{"type":225,"tag":266,"props":1275,"children":1276},{"class":268,"line":428},[1277,1281,1285,1290,1295],{"type":225,"tag":266,"props":1278,"children":1279},{"style":678},[1280],{"type":230,"value":718},{"type":225,"tag":266,"props":1282,"children":1283},{"style":678},[1284],{"type":230,"value":723},{"type":225,"tag":266,"props":1286,"children":1287},{"style":628},[1288],{"type":230,"value":1289}," IOpenWeatherMapApi",{"type":225,"tag":266,"props":1291,"children":1292},{"style":628},[1293],{"type":230,"value":1294}," _openWeatherMapApi",{"type":225,"tag":266,"props":1296,"children":1297},{"style":279},[1298],{"type":230,"value":738},{"type":225,"tag":266,"props":1300,"children":1301},{"class":268,"line":443},[1302,1306,1311,1315,1320,1325,1330,1335,1340,1344,1349,1353,1358,1363,1367,1371,1376],{"type":225,"tag":266,"props":1303,"children":1304},{"style":678},[1305],{"type":230,"value":718},{"type":225,"tag":266,"props":1307,"children":1308},{"style":678},[1309],{"type":230,"value":1310}," static",{"type":225,"tag":266,"props":1312,"children":1313},{"style":678},[1314],{"type":230,"value":723},{"type":225,"tag":266,"props":1316,"children":1317},{"style":279},[1318],{"type":230,"value":1319}," (double",{"type":225,"tag":266,"props":1321,"children":1322},{"style":628},[1323],{"type":230,"value":1324}," Latitude",{"type":225,"tag":266,"props":1326,"children":1327},{"style":279},[1328],{"type":230,"value":1329},",",{"type":225,"tag":266,"props":1331,"children":1332},{"style":279},[1333],{"type":230,"value":1334}," double",{"type":225,"tag":266,"props":1336,"children":1337},{"style":628},[1338],{"type":230,"value":1339}," Longitude",{"type":225,"tag":266,"props":1341,"children":1342},{"style":279},[1343],{"type":230,"value":481},{"type":225,"tag":266,"props":1345,"children":1346},{"style":628},[1347],{"type":230,"value":1348}," BordeauxCoordinates",{"type":225,"tag":266,"props":1350,"children":1351},{"style":279},[1352],{"type":230,"value":853},{"type":225,"tag":266,"props":1354,"children":1355},{"style":279},[1356],{"type":230,"value":1357}," (",{"type":225,"tag":266,"props":1359,"children":1360},{"style":290},[1361],{"type":230,"value":1362},"44.837789",{"type":225,"tag":266,"props":1364,"children":1365},{"style":279},[1366],{"type":230,"value":1329},{"type":225,"tag":266,"props":1368,"children":1369},{"style":279},[1370],{"type":230,"value":345},{"type":225,"tag":266,"props":1372,"children":1373},{"style":290},[1374],{"type":230,"value":1375},"0.57918",{"type":225,"tag":266,"props":1377,"children":1378},{"style":279},[1379],{"type":230,"value":1380},");\n",{"type":225,"tag":266,"props":1382,"children":1383},{"class":268,"line":712},[1384],{"type":225,"tag":266,"props":1385,"children":1386},{"emptyLinePlaceholder":422},[1387],{"type":230,"value":425},{"type":225,"tag":266,"props":1389,"children":1390},{"class":268,"line":741},[1391,1395,1399,1403,1408,1413],{"type":225,"tag":266,"props":1392,"children":1393},{"style":678},[1394],{"type":230,"value":755},{"type":225,"tag":266,"props":1396,"children":1397},{"style":337},[1398],{"type":230,"value":1257},{"type":225,"tag":266,"props":1400,"children":1401},{"style":279},[1402],{"type":230,"value":653},{"type":225,"tag":266,"props":1404,"children":1405},{"style":628},[1406],{"type":230,"value":1407},"IOpenWeatherMapApi",{"type":225,"tag":266,"props":1409,"children":1410},{"style":628},[1411],{"type":230,"value":1412}," openWeatherMapApi",{"type":225,"tag":266,"props":1414,"children":1415},{"style":279},[1416],{"type":230,"value":777},{"type":225,"tag":266,"props":1418,"children":1419},{"class":268,"line":749},[1420],{"type":225,"tag":266,"props":1421,"children":1422},{"style":279},[1423],{"type":230,"value":786},{"type":225,"tag":266,"props":1425,"children":1426},{"class":268,"line":780},[1427,1432,1436,1440],{"type":225,"tag":266,"props":1428,"children":1429},{"style":273},[1430],{"type":230,"value":1431},"        _openWeatherMapApi ",{"type":225,"tag":266,"props":1433,"children":1434},{"style":279},[1435],{"type":230,"value":800},{"type":225,"tag":266,"props":1437,"children":1438},{"style":273},[1439],{"type":230,"value":1412},{"type":225,"tag":266,"props":1441,"children":1442},{"style":279},[1443],{"type":230,"value":738},{"type":225,"tag":266,"props":1445,"children":1446},{"class":268,"line":789},[1447],{"type":225,"tag":266,"props":1448,"children":1449},{"style":279},[1450],{"type":230,"value":817},{"type":225,"tag":266,"props":1452,"children":1453},{"class":268,"line":811},[1454],{"type":225,"tag":266,"props":1455,"children":1456},{"emptyLinePlaceholder":422},[1457],{"type":230,"value":425},{"type":225,"tag":266,"props":1459,"children":1460},{"class":268,"line":820},[1461,1465,1470,1474,1478,1482,1486,1491],{"type":225,"tag":266,"props":1462,"children":1463},{"style":678},[1464],{"type":230,"value":755},{"type":225,"tag":266,"props":1466,"children":1467},{"style":678},[1468],{"type":230,"value":1469}," async",{"type":225,"tag":266,"props":1471,"children":1472},{"style":628},[1473],{"type":230,"value":930},{"type":225,"tag":266,"props":1475,"children":1476},{"style":279},[1477],{"type":230,"value":935},{"type":225,"tag":266,"props":1479,"children":1480},{"style":628},[1481],{"type":230,"value":894},{"type":225,"tag":266,"props":1483,"children":1484},{"style":279},[1485],{"type":230,"value":944},{"type":225,"tag":266,"props":1487,"children":1488},{"style":337},[1489],{"type":230,"value":1490}," GetWeatherForecasts",{"type":225,"tag":266,"props":1492,"children":1493},{"style":279},[1494],{"type":230,"value":954},{"type":225,"tag":266,"props":1496,"children":1497},{"class":268,"line":828},[1498],{"type":225,"tag":266,"props":1499,"children":1500},{"style":279},[1501],{"type":230,"value":786},{"type":225,"tag":266,"props":1503,"children":1504},{"class":268,"line":874},[1505,1510,1515,1519,1524,1528,1532,1536,1540,1545,1549,1554,1558,1562,1566,1571],{"type":225,"tag":266,"props":1506,"children":1507},{"style":628},[1508],{"type":230,"value":1509},"        var",{"type":225,"tag":266,"props":1511,"children":1512},{"style":628},[1513],{"type":230,"value":1514}," weatherApiResponse",{"type":225,"tag":266,"props":1516,"children":1517},{"style":279},[1518],{"type":230,"value":853},{"type":225,"tag":266,"props":1520,"children":1521},{"style":279},[1522],{"type":230,"value":1523}," await",{"type":225,"tag":266,"props":1525,"children":1526},{"style":273},[1527],{"type":230,"value":1294},{"type":225,"tag":266,"props":1529,"children":1530},{"style":279},[1531],{"type":230,"value":518},{"type":225,"tag":266,"props":1533,"children":1534},{"style":337},[1535],{"type":230,"value":863},{"type":225,"tag":266,"props":1537,"children":1538},{"style":279},[1539],{"type":230,"value":653},{"type":225,"tag":266,"props":1541,"children":1542},{"style":273},[1543],{"type":230,"value":1544},"BordeauxCoordinates",{"type":225,"tag":266,"props":1546,"children":1547},{"style":279},[1548],{"type":230,"value":518},{"type":225,"tag":266,"props":1550,"children":1551},{"style":273},[1552],{"type":230,"value":1553},"Latitude",{"type":225,"tag":266,"props":1555,"children":1556},{"style":279},[1557],{"type":230,"value":1329},{"type":225,"tag":266,"props":1559,"children":1560},{"style":273},[1561],{"type":230,"value":1348},{"type":225,"tag":266,"props":1563,"children":1564},{"style":279},[1565],{"type":230,"value":518},{"type":225,"tag":266,"props":1567,"children":1568},{"style":273},[1569],{"type":230,"value":1570},"Longitude",{"type":225,"tag":266,"props":1572,"children":1573},{"style":279},[1574],{"type":230,"value":1380},{"type":225,"tag":266,"props":1576,"children":1577},{"class":268,"line":920},[1578],{"type":225,"tag":266,"props":1579,"children":1580},{"style":273},[1581],{"type":230,"value":1582},"        \n",{"type":225,"tag":266,"props":1584,"children":1585},{"class":268,"line":957},[1586,1590,1595,1599,1603,1608,1612],{"type":225,"tag":266,"props":1587,"children":1588},{"style":628},[1589],{"type":230,"value":1509},{"type":225,"tag":266,"props":1591,"children":1592},{"style":628},[1593],{"type":230,"value":1594}," computeWeatherSummary",{"type":225,"tag":266,"props":1596,"children":1597},{"style":279},[1598],{"type":230,"value":853},{"type":225,"tag":266,"props":1600,"children":1601},{"style":279},[1602],{"type":230,"value":1319},{"type":225,"tag":266,"props":1604,"children":1605},{"style":628},[1606],{"type":230,"value":1607}," temperature",{"type":225,"tag":266,"props":1609,"children":1610},{"style":279},[1611],{"type":230,"value":481},{"type":225,"tag":266,"props":1613,"children":1614},{"style":279},[1615],{"type":230,"value":1616}," =>\n",{"type":225,"tag":266,"props":1618,"children":1619},{"class":268,"line":965},[1620,1625],{"type":225,"tag":266,"props":1621,"children":1622},{"style":273},[1623],{"type":230,"value":1624},"            temperature ",{"type":225,"tag":266,"props":1626,"children":1627},{"style":432},[1628],{"type":230,"value":1629},"switch\n",{"type":225,"tag":266,"props":1631,"children":1632},{"class":268,"line":992},[1633],{"type":225,"tag":266,"props":1634,"children":1635},{"style":279},[1636],{"type":230,"value":1637},"            {\n",{"type":225,"tag":266,"props":1639,"children":1640},{"class":268,"line":1000},[1641,1646,1651,1656,1660,1665,1669],{"type":225,"tag":266,"props":1642,"children":1643},{"style":279},[1644],{"type":230,"value":1645},"                \u003C",{"type":225,"tag":266,"props":1647,"children":1648},{"style":290},[1649],{"type":230,"value":1650}," 0",{"type":225,"tag":266,"props":1652,"children":1653},{"style":279},[1654],{"type":230,"value":1655}," =>",{"type":225,"tag":266,"props":1657,"children":1658},{"style":279},[1659],{"type":230,"value":858},{"type":225,"tag":266,"props":1661,"children":1662},{"style":412},[1663],{"type":230,"value":1664},"Freezing",{"type":225,"tag":266,"props":1666,"children":1667},{"style":279},[1668],{"type":230,"value":658},{"type":225,"tag":266,"props":1670,"children":1671},{"style":279},[1672],{"type":230,"value":1673},",\n",{"type":225,"tag":266,"props":1675,"children":1677},{"class":268,"line":1676},19,[1678,1683,1687,1692,1697,1702,1706,1710,1715,1719],{"type":225,"tag":266,"props":1679,"children":1680},{"style":279},[1681],{"type":230,"value":1682},"                >=",{"type":225,"tag":266,"props":1684,"children":1685},{"style":290},[1686],{"type":230,"value":1650},{"type":225,"tag":266,"props":1688,"children":1689},{"style":279},[1690],{"type":230,"value":1691}," and",{"type":225,"tag":266,"props":1693,"children":1694},{"style":279},[1695],{"type":230,"value":1696}," \u003C",{"type":225,"tag":266,"props":1698,"children":1699},{"style":290},[1700],{"type":230,"value":1701}," 5",{"type":225,"tag":266,"props":1703,"children":1704},{"style":279},[1705],{"type":230,"value":1655},{"type":225,"tag":266,"props":1707,"children":1708},{"style":279},[1709],{"type":230,"value":858},{"type":225,"tag":266,"props":1711,"children":1712},{"style":412},[1713],{"type":230,"value":1714},"Bracing",{"type":225,"tag":266,"props":1716,"children":1717},{"style":279},[1718],{"type":230,"value":658},{"type":225,"tag":266,"props":1720,"children":1721},{"style":279},[1722],{"type":230,"value":1673},{"type":225,"tag":266,"props":1724,"children":1726},{"class":268,"line":1725},20,[1727,1731,1735,1739,1743,1748,1752,1756,1761,1765],{"type":225,"tag":266,"props":1728,"children":1729},{"style":279},[1730],{"type":230,"value":1682},{"type":225,"tag":266,"props":1732,"children":1733},{"style":290},[1734],{"type":230,"value":1701},{"type":225,"tag":266,"props":1736,"children":1737},{"style":279},[1738],{"type":230,"value":1691},{"type":225,"tag":266,"props":1740,"children":1741},{"style":279},[1742],{"type":230,"value":1696},{"type":225,"tag":266,"props":1744,"children":1745},{"style":290},[1746],{"type":230,"value":1747}," 12",{"type":225,"tag":266,"props":1749,"children":1750},{"style":279},[1751],{"type":230,"value":1655},{"type":225,"tag":266,"props":1753,"children":1754},{"style":279},[1755],{"type":230,"value":858},{"type":225,"tag":266,"props":1757,"children":1758},{"style":412},[1759],{"type":230,"value":1760},"Chilly",{"type":225,"tag":266,"props":1762,"children":1763},{"style":279},[1764],{"type":230,"value":658},{"type":225,"tag":266,"props":1766,"children":1767},{"style":279},[1768],{"type":230,"value":1673},{"type":225,"tag":266,"props":1770,"children":1772},{"class":268,"line":1771},21,[1773,1777,1781,1785,1789,1794,1798,1802,1807,1811],{"type":225,"tag":266,"props":1774,"children":1775},{"style":279},[1776],{"type":230,"value":1682},{"type":225,"tag":266,"props":1778,"children":1779},{"style":290},[1780],{"type":230,"value":1747},{"type":225,"tag":266,"props":1782,"children":1783},{"style":279},[1784],{"type":230,"value":1691},{"type":225,"tag":266,"props":1786,"children":1787},{"style":279},[1788],{"type":230,"value":1696},{"type":225,"tag":266,"props":1790,"children":1791},{"style":290},[1792],{"type":230,"value":1793}," 18",{"type":225,"tag":266,"props":1795,"children":1796},{"style":279},[1797],{"type":230,"value":1655},{"type":225,"tag":266,"props":1799,"children":1800},{"style":279},[1801],{"type":230,"value":858},{"type":225,"tag":266,"props":1803,"children":1804},{"style":412},[1805],{"type":230,"value":1806},"Cool",{"type":225,"tag":266,"props":1808,"children":1809},{"style":279},[1810],{"type":230,"value":658},{"type":225,"tag":266,"props":1812,"children":1813},{"style":279},[1814],{"type":230,"value":1673},{"type":225,"tag":266,"props":1816,"children":1818},{"class":268,"line":1817},22,[1819,1823,1827,1831,1835,1840,1844,1848,1853,1857],{"type":225,"tag":266,"props":1820,"children":1821},{"style":279},[1822],{"type":230,"value":1682},{"type":225,"tag":266,"props":1824,"children":1825},{"style":290},[1826],{"type":230,"value":1793},{"type":225,"tag":266,"props":1828,"children":1829},{"style":279},[1830],{"type":230,"value":1691},{"type":225,"tag":266,"props":1832,"children":1833},{"style":279},[1834],{"type":230,"value":1696},{"type":225,"tag":266,"props":1836,"children":1837},{"style":290},[1838],{"type":230,"value":1839}," 24",{"type":225,"tag":266,"props":1841,"children":1842},{"style":279},[1843],{"type":230,"value":1655},{"type":225,"tag":266,"props":1845,"children":1846},{"style":279},[1847],{"type":230,"value":858},{"type":225,"tag":266,"props":1849,"children":1850},{"style":412},[1851],{"type":230,"value":1852},"Mild",{"type":225,"tag":266,"props":1854,"children":1855},{"style":279},[1856],{"type":230,"value":658},{"type":225,"tag":266,"props":1858,"children":1859},{"style":279},[1860],{"type":230,"value":1673},{"type":225,"tag":266,"props":1862,"children":1864},{"class":268,"line":1863},23,[1865,1869,1873,1877,1881,1886,1890,1894,1899,1903],{"type":225,"tag":266,"props":1866,"children":1867},{"style":279},[1868],{"type":230,"value":1682},{"type":225,"tag":266,"props":1870,"children":1871},{"style":290},[1872],{"type":230,"value":1839},{"type":225,"tag":266,"props":1874,"children":1875},{"style":279},[1876],{"type":230,"value":1691},{"type":225,"tag":266,"props":1878,"children":1879},{"style":279},[1880],{"type":230,"value":1696},{"type":225,"tag":266,"props":1882,"children":1883},{"style":290},[1884],{"type":230,"value":1885}," 30",{"type":225,"tag":266,"props":1887,"children":1888},{"style":279},[1889],{"type":230,"value":1655},{"type":225,"tag":266,"props":1891,"children":1892},{"style":279},[1893],{"type":230,"value":858},{"type":225,"tag":266,"props":1895,"children":1896},{"style":412},[1897],{"type":230,"value":1898},"Warm",{"type":225,"tag":266,"props":1900,"children":1901},{"style":279},[1902],{"type":230,"value":658},{"type":225,"tag":266,"props":1904,"children":1905},{"style":279},[1906],{"type":230,"value":1673},{"type":225,"tag":266,"props":1908,"children":1910},{"class":268,"line":1909},24,[1911,1915,1919,1923,1927,1932,1936,1940,1945,1949],{"type":225,"tag":266,"props":1912,"children":1913},{"style":279},[1914],{"type":230,"value":1682},{"type":225,"tag":266,"props":1916,"children":1917},{"style":290},[1918],{"type":230,"value":1885},{"type":225,"tag":266,"props":1920,"children":1921},{"style":279},[1922],{"type":230,"value":1691},{"type":225,"tag":266,"props":1924,"children":1925},{"style":279},[1926],{"type":230,"value":1696},{"type":225,"tag":266,"props":1928,"children":1929},{"style":290},[1930],{"type":230,"value":1931}," 35",{"type":225,"tag":266,"props":1933,"children":1934},{"style":279},[1935],{"type":230,"value":1655},{"type":225,"tag":266,"props":1937,"children":1938},{"style":279},[1939],{"type":230,"value":858},{"type":225,"tag":266,"props":1941,"children":1942},{"style":412},[1943],{"type":230,"value":1944},"Balmy",{"type":225,"tag":266,"props":1946,"children":1947},{"style":279},[1948],{"type":230,"value":658},{"type":225,"tag":266,"props":1950,"children":1951},{"style":279},[1952],{"type":230,"value":1673},{"type":225,"tag":266,"props":1954,"children":1956},{"class":268,"line":1955},25,[1957,1961,1965,1969,1973,1978,1982,1986,1991,1995],{"type":225,"tag":266,"props":1958,"children":1959},{"style":279},[1960],{"type":230,"value":1682},{"type":225,"tag":266,"props":1962,"children":1963},{"style":290},[1964],{"type":230,"value":1931},{"type":225,"tag":266,"props":1966,"children":1967},{"style":279},[1968],{"type":230,"value":1691},{"type":225,"tag":266,"props":1970,"children":1971},{"style":279},[1972],{"type":230,"value":1696},{"type":225,"tag":266,"props":1974,"children":1975},{"style":290},[1976],{"type":230,"value":1977}," 40",{"type":225,"tag":266,"props":1979,"children":1980},{"style":279},[1981],{"type":230,"value":1655},{"type":225,"tag":266,"props":1983,"children":1984},{"style":279},[1985],{"type":230,"value":858},{"type":225,"tag":266,"props":1987,"children":1988},{"style":412},[1989],{"type":230,"value":1990},"Hot",{"type":225,"tag":266,"props":1992,"children":1993},{"style":279},[1994],{"type":230,"value":658},{"type":225,"tag":266,"props":1996,"children":1997},{"style":279},[1998],{"type":230,"value":1673},{"type":225,"tag":266,"props":2000,"children":2002},{"class":268,"line":2001},26,[2003,2007,2011,2015,2019,2024,2028,2032,2037,2041],{"type":225,"tag":266,"props":2004,"children":2005},{"style":279},[2006],{"type":230,"value":1682},{"type":225,"tag":266,"props":2008,"children":2009},{"style":290},[2010],{"type":230,"value":1977},{"type":225,"tag":266,"props":2012,"children":2013},{"style":279},[2014],{"type":230,"value":1691},{"type":225,"tag":266,"props":2016,"children":2017},{"style":279},[2018],{"type":230,"value":1696},{"type":225,"tag":266,"props":2020,"children":2021},{"style":290},[2022],{"type":230,"value":2023}," 45",{"type":225,"tag":266,"props":2025,"children":2026},{"style":279},[2027],{"type":230,"value":1655},{"type":225,"tag":266,"props":2029,"children":2030},{"style":279},[2031],{"type":230,"value":858},{"type":225,"tag":266,"props":2033,"children":2034},{"style":412},[2035],{"type":230,"value":2036},"Sweltering",{"type":225,"tag":266,"props":2038,"children":2039},{"style":279},[2040],{"type":230,"value":658},{"type":225,"tag":266,"props":2042,"children":2043},{"style":279},[2044],{"type":230,"value":1673},{"type":225,"tag":266,"props":2046,"children":2048},{"class":268,"line":2047},27,[2049,2053,2057,2061,2065,2070,2074],{"type":225,"tag":266,"props":2050,"children":2051},{"style":279},[2052],{"type":230,"value":1682},{"type":225,"tag":266,"props":2054,"children":2055},{"style":290},[2056],{"type":230,"value":2023},{"type":225,"tag":266,"props":2058,"children":2059},{"style":279},[2060],{"type":230,"value":1655},{"type":225,"tag":266,"props":2062,"children":2063},{"style":279},[2064],{"type":230,"value":858},{"type":225,"tag":266,"props":2066,"children":2067},{"style":412},[2068],{"type":230,"value":2069},"Scorching",{"type":225,"tag":266,"props":2071,"children":2072},{"style":279},[2073],{"type":230,"value":658},{"type":225,"tag":266,"props":2075,"children":2076},{"style":279},[2077],{"type":230,"value":1673},{"type":225,"tag":266,"props":2079,"children":2081},{"class":268,"line":2080},28,[2082,2087,2092,2096,2100],{"type":225,"tag":266,"props":2083,"children":2084},{"style":273},[2085],{"type":230,"value":2086},"                _ ",{"type":225,"tag":266,"props":2088,"children":2089},{"style":279},[2090],{"type":230,"value":2091},"=>",{"type":225,"tag":266,"props":2093,"children":2094},{"style":279},[2095],{"type":230,"value":858},{"type":225,"tag":266,"props":2097,"children":2098},{"style":412},[2099],{"type":230,"value":1898},{"type":225,"tag":266,"props":2101,"children":2102},{"style":279},[2103],{"type":230,"value":2104},"\"\n",{"type":225,"tag":266,"props":2106,"children":2108},{"class":268,"line":2107},29,[2109],{"type":225,"tag":266,"props":2110,"children":2111},{"style":279},[2112],{"type":230,"value":2113},"            };\n",{"type":225,"tag":266,"props":2115,"children":2117},{"class":268,"line":2116},30,[2118,2122,2126,2130],{"type":225,"tag":266,"props":2119,"children":2120},{"style":432},[2121],{"type":230,"value":971},{"type":225,"tag":266,"props":2123,"children":2124},{"style":273},[2125],{"type":230,"value":1514},{"type":225,"tag":266,"props":2127,"children":2128},{"style":279},[2129],{"type":230,"value":518},{"type":225,"tag":266,"props":2131,"children":2132},{"style":273},[2133],{"type":230,"value":2134},"List\n",{"type":225,"tag":266,"props":2136,"children":2138},{"class":268,"line":2137},31,[2139,2144,2149,2153,2158],{"type":225,"tag":266,"props":2140,"children":2141},{"style":279},[2142],{"type":230,"value":2143},"            .",{"type":225,"tag":266,"props":2145,"children":2146},{"style":337},[2147],{"type":230,"value":2148},"Select",{"type":225,"tag":266,"props":2150,"children":2151},{"style":279},[2152],{"type":230,"value":653},{"type":225,"tag":266,"props":2154,"children":2155},{"style":628},[2156],{"type":230,"value":2157},"x",{"type":225,"tag":266,"props":2159,"children":2160},{"style":279},[2161],{"type":230,"value":1616},{"type":225,"tag":266,"props":2163,"children":2165},{"class":268,"line":2164},32,[2166,2171],{"type":225,"tag":266,"props":2167,"children":2168},{"style":279},[2169],{"type":230,"value":2170},"                new",{"type":225,"tag":266,"props":2172,"children":2173},{"style":628},[2174],{"type":230,"value":2175}," WeatherForecast\n",{"type":225,"tag":266,"props":2177,"children":2179},{"class":268,"line":2178},33,[2180],{"type":225,"tag":266,"props":2181,"children":2182},{"style":279},[2183],{"type":230,"value":2184},"                {\n",{"type":225,"tag":266,"props":2186,"children":2188},{"class":268,"line":2187},34,[2189,2194,2198,2203,2207,2212,2216,2221,2225,2230,2234,2238,2242,2247,2252,2257],{"type":225,"tag":266,"props":2190,"children":2191},{"style":273},[2192],{"type":230,"value":2193},"                    Date ",{"type":225,"tag":266,"props":2195,"children":2196},{"style":279},[2197],{"type":230,"value":800},{"type":225,"tag":266,"props":2199,"children":2200},{"style":273},[2201],{"type":230,"value":2202}," DateOnly",{"type":225,"tag":266,"props":2204,"children":2205},{"style":279},[2206],{"type":230,"value":518},{"type":225,"tag":266,"props":2208,"children":2209},{"style":337},[2210],{"type":230,"value":2211},"FromDateTime",{"type":225,"tag":266,"props":2213,"children":2214},{"style":279},[2215],{"type":230,"value":653},{"type":225,"tag":266,"props":2217,"children":2218},{"style":273},[2219],{"type":230,"value":2220},"DateTimeOffset",{"type":225,"tag":266,"props":2222,"children":2223},{"style":279},[2224],{"type":230,"value":518},{"type":225,"tag":266,"props":2226,"children":2227},{"style":337},[2228],{"type":230,"value":2229},"FromUnixTimeSeconds",{"type":225,"tag":266,"props":2231,"children":2232},{"style":279},[2233],{"type":230,"value":653},{"type":225,"tag":266,"props":2235,"children":2236},{"style":273},[2237],{"type":230,"value":2157},{"type":225,"tag":266,"props":2239,"children":2240},{"style":279},[2241],{"type":230,"value":518},{"type":225,"tag":266,"props":2243,"children":2244},{"style":273},[2245],{"type":230,"value":2246},"Dt",{"type":225,"tag":266,"props":2248,"children":2249},{"style":279},[2250],{"type":230,"value":2251},").",{"type":225,"tag":266,"props":2253,"children":2254},{"style":273},[2255],{"type":230,"value":2256},"Date",{"type":225,"tag":266,"props":2258,"children":2259},{"style":279},[2260],{"type":230,"value":2261},"),\n",{"type":225,"tag":266,"props":2263,"children":2265},{"class":268,"line":2264},35,[2266,2271,2275,2280,2284,2289,2293,2297,2301,2306,2310,2315],{"type":225,"tag":266,"props":2267,"children":2268},{"style":273},[2269],{"type":230,"value":2270},"                    TemperatureC ",{"type":225,"tag":266,"props":2272,"children":2273},{"style":279},[2274],{"type":230,"value":800},{"type":225,"tag":266,"props":2276,"children":2277},{"style":273},[2278],{"type":230,"value":2279}," Convert",{"type":225,"tag":266,"props":2281,"children":2282},{"style":279},[2283],{"type":230,"value":518},{"type":225,"tag":266,"props":2285,"children":2286},{"style":337},[2287],{"type":230,"value":2288},"ToInt32",{"type":225,"tag":266,"props":2290,"children":2291},{"style":279},[2292],{"type":230,"value":653},{"type":225,"tag":266,"props":2294,"children":2295},{"style":273},[2296],{"type":230,"value":2157},{"type":225,"tag":266,"props":2298,"children":2299},{"style":279},[2300],{"type":230,"value":518},{"type":225,"tag":266,"props":2302,"children":2303},{"style":273},[2304],{"type":230,"value":2305},"Main",{"type":225,"tag":266,"props":2307,"children":2308},{"style":279},[2309],{"type":230,"value":518},{"type":225,"tag":266,"props":2311,"children":2312},{"style":273},[2313],{"type":230,"value":2314},"Temp",{"type":225,"tag":266,"props":2316,"children":2317},{"style":279},[2318],{"type":230,"value":2261},{"type":225,"tag":266,"props":2320,"children":2322},{"class":268,"line":2321},36,[2323,2328,2332,2336,2340,2344,2348,2352,2356,2360],{"type":225,"tag":266,"props":2324,"children":2325},{"style":273},[2326],{"type":230,"value":2327},"                    Summary ",{"type":225,"tag":266,"props":2329,"children":2330},{"style":279},[2331],{"type":230,"value":800},{"type":225,"tag":266,"props":2333,"children":2334},{"style":337},[2335],{"type":230,"value":1594},{"type":225,"tag":266,"props":2337,"children":2338},{"style":279},[2339],{"type":230,"value":653},{"type":225,"tag":266,"props":2341,"children":2342},{"style":273},[2343],{"type":230,"value":2157},{"type":225,"tag":266,"props":2345,"children":2346},{"style":279},[2347],{"type":230,"value":518},{"type":225,"tag":266,"props":2349,"children":2350},{"style":273},[2351],{"type":230,"value":2305},{"type":225,"tag":266,"props":2353,"children":2354},{"style":279},[2355],{"type":230,"value":518},{"type":225,"tag":266,"props":2357,"children":2358},{"style":273},[2359],{"type":230,"value":2314},{"type":225,"tag":266,"props":2361,"children":2362},{"style":279},[2363],{"type":230,"value":777},{"type":225,"tag":266,"props":2365,"children":2367},{"class":268,"line":2366},37,[2368],{"type":225,"tag":266,"props":2369,"children":2370},{"style":279},[2371],{"type":230,"value":2372},"                })\n",{"type":225,"tag":266,"props":2374,"children":2376},{"class":268,"line":2375},38,[2377,2381,2386],{"type":225,"tag":266,"props":2378,"children":2379},{"style":279},[2380],{"type":230,"value":2143},{"type":225,"tag":266,"props":2382,"children":2383},{"style":337},[2384],{"type":230,"value":2385},"ToArray",{"type":225,"tag":266,"props":2387,"children":2388},{"style":279},[2389],{"type":230,"value":989},{"type":225,"tag":266,"props":2391,"children":2393},{"class":268,"line":2392},39,[2394],{"type":225,"tag":266,"props":2395,"children":2396},{"style":279},[2397],{"type":230,"value":817},{"type":225,"tag":266,"props":2399,"children":2401},{"class":268,"line":2400},40,[2402],{"type":225,"tag":266,"props":2403,"children":2404},{"style":279},[2405],{"type":230,"value":1006},{"type":225,"tag":226,"props":2407,"children":2408},{},[2409],{"type":230,"value":2410},"The weather forecasts of a specific geolocation are retrieved. Indeed coordinates (corresponding to Bordeaux in France) are passed to the Open Weather Map API call. In C# 12, we can alias any type so we can introduce an alias \"Coordinates\" for the coordinates tuple:",{"type":225,"tag":255,"props":2412,"children":2414},{"className":612,"code":2413,"language":216,"meta":207,"style":207},"using Coordinates = (double Latitude, double Longitude);\n\npublic class OpenWeatherService : IWeatherService\n{\n    private readonly IOpenWeatherMapApi _openWeatherMapApi;\n    private static readonly Coordinates BordeauxCoordinates = (44.837789, -0.57918\n",[2415],{"type":225,"tag":262,"props":2416,"children":2417},{"__ignoreMap":207},[2418,2459,2466,2489,2496,2519],{"type":225,"tag":266,"props":2419,"children":2420},{"class":268,"line":269},[2421,2426,2431,2435,2439,2443,2447,2451,2455],{"type":225,"tag":266,"props":2422,"children":2423},{"style":290},[2424],{"type":230,"value":2425},"using",{"type":225,"tag":266,"props":2427,"children":2428},{"style":628},[2429],{"type":230,"value":2430}," Coordinates",{"type":225,"tag":266,"props":2432,"children":2433},{"style":279},[2434],{"type":230,"value":853},{"type":225,"tag":266,"props":2436,"children":2437},{"style":279},[2438],{"type":230,"value":1319},{"type":225,"tag":266,"props":2440,"children":2441},{"style":628},[2442],{"type":230,"value":1324},{"type":225,"tag":266,"props":2444,"children":2445},{"style":279},[2446],{"type":230,"value":1329},{"type":225,"tag":266,"props":2448,"children":2449},{"style":279},[2450],{"type":230,"value":1334},{"type":225,"tag":266,"props":2452,"children":2453},{"style":628},[2454],{"type":230,"value":1339},{"type":225,"tag":266,"props":2456,"children":2457},{"style":279},[2458],{"type":230,"value":1380},{"type":225,"tag":266,"props":2460,"children":2461},{"class":268,"line":418},[2462],{"type":225,"tag":266,"props":2463,"children":2464},{"emptyLinePlaceholder":422},[2465],{"type":230,"value":425},{"type":225,"tag":266,"props":2467,"children":2468},{"class":268,"line":428},[2469,2473,2477,2481,2485],{"type":225,"tag":266,"props":2470,"children":2471},{"style":678},[2472],{"type":230,"value":681},{"type":225,"tag":266,"props":2474,"children":2475},{"style":628},[2476],{"type":230,"value":686},{"type":225,"tag":266,"props":2478,"children":2479},{"style":628},[2480],{"type":230,"value":1257},{"type":225,"tag":266,"props":2482,"children":2483},{"style":279},[2484],{"type":230,"value":696},{"type":225,"tag":266,"props":2486,"children":2487},{"style":628},[2488],{"type":230,"value":1266},{"type":225,"tag":266,"props":2490,"children":2491},{"class":268,"line":443},[2492],{"type":225,"tag":266,"props":2493,"children":2494},{"style":279},[2495],{"type":230,"value":709},{"type":225,"tag":266,"props":2497,"children":2498},{"class":268,"line":712},[2499,2503,2507,2511,2515],{"type":225,"tag":266,"props":2500,"children":2501},{"style":678},[2502],{"type":230,"value":718},{"type":225,"tag":266,"props":2504,"children":2505},{"style":678},[2506],{"type":230,"value":723},{"type":225,"tag":266,"props":2508,"children":2509},{"style":628},[2510],{"type":230,"value":1289},{"type":225,"tag":266,"props":2512,"children":2513},{"style":628},[2514],{"type":230,"value":1294},{"type":225,"tag":266,"props":2516,"children":2517},{"style":279},[2518],{"type":230,"value":738},{"type":225,"tag":266,"props":2520,"children":2521},{"class":268,"line":741},[2522,2526,2530,2534,2538,2542,2546,2550,2554,2558,2562],{"type":225,"tag":266,"props":2523,"children":2524},{"style":678},[2525],{"type":230,"value":718},{"type":225,"tag":266,"props":2527,"children":2528},{"style":678},[2529],{"type":230,"value":1310},{"type":225,"tag":266,"props":2531,"children":2532},{"style":678},[2533],{"type":230,"value":723},{"type":225,"tag":266,"props":2535,"children":2536},{"style":628},[2537],{"type":230,"value":2430},{"type":225,"tag":266,"props":2539,"children":2540},{"style":628},[2541],{"type":230,"value":1348},{"type":225,"tag":266,"props":2543,"children":2544},{"style":279},[2545],{"type":230,"value":853},{"type":225,"tag":266,"props":2547,"children":2548},{"style":279},[2549],{"type":230,"value":1357},{"type":225,"tag":266,"props":2551,"children":2552},{"style":290},[2553],{"type":230,"value":1362},{"type":225,"tag":266,"props":2555,"children":2556},{"style":279},[2557],{"type":230,"value":1329},{"type":225,"tag":266,"props":2559,"children":2560},{"style":279},[2561],{"type":230,"value":345},{"type":225,"tag":266,"props":2563,"children":2564},{"style":290},[2565],{"type":230,"value":2566},"0.57918\n",{"type":225,"tag":226,"props":2568,"children":2569},{},[2570,2572,2577,2579,2586],{"type":230,"value":2571},"Once this call is done, results are mapped to the expected model ",{"type":225,"tag":262,"props":2573,"children":2575},{"className":2574},[],[2576],{"type":230,"value":894},{"type":230,"value":2578},". A lambda expression is used to get the \"weather summary\" from a temperature. If we want to have a default summary, that's something we can do thanks to the support of ",{"type":225,"tag":244,"props":2580,"children":2583},{"href":2581,"rel":2582},"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#default-lambda-parameters",[248],[2584],{"type":230,"value":2585},"default lambda parameters",{"type":230,"value":2587}," in C#12.",{"type":225,"tag":255,"props":2589,"children":2591},{"className":612,"code":2590,"language":216,"meta":207,"style":207},"var computeWeatherSummary = (double temperature, string defaultSummary = \"Warm\") =>\n    temperature switch\n    {\n        \u003C 0 => \"Freezing\",\n        >= 0 and \u003C 5 => \"Bracing\",\n        >= 5 and \u003C 12 => \"Chilly\",\n        >= 12 and \u003C 18 => \"Cool\",\n        >= 18 and \u003C 24 => \"Mild\",\n        >= 24 and \u003C 30 => \"Warm\",\n        >= 30 and \u003C 35 => \"Balmy\",\n        >= 35 and \u003C 40 => \"Hot\",\n        >= 40 and \u003C 45 => \"Sweltering\",\n        >= 45 => \"Scorching\",\n        _ => defaultSummary\n    };\n",[2592],{"type":225,"tag":262,"props":2593,"children":2594},{"__ignoreMap":207},[2595,2657,2669,2676,2708,2752,2795,2838,2881,2924,2967,3010,3053,3084,3101],{"type":225,"tag":266,"props":2596,"children":2597},{"class":268,"line":269},[2598,2603,2607,2611,2615,2619,2623,2628,2633,2637,2641,2645,2649,2653],{"type":225,"tag":266,"props":2599,"children":2600},{"style":628},[2601],{"type":230,"value":2602},"var",{"type":225,"tag":266,"props":2604,"children":2605},{"style":628},[2606],{"type":230,"value":1594},{"type":225,"tag":266,"props":2608,"children":2609},{"style":279},[2610],{"type":230,"value":853},{"type":225,"tag":266,"props":2612,"children":2613},{"style":279},[2614],{"type":230,"value":1319},{"type":225,"tag":266,"props":2616,"children":2617},{"style":628},[2618],{"type":230,"value":1607},{"type":225,"tag":266,"props":2620,"children":2621},{"style":279},[2622],{"type":230,"value":1329},{"type":225,"tag":266,"props":2624,"children":2625},{"style":279},[2626],{"type":230,"value":2627}," string",{"type":225,"tag":266,"props":2629,"children":2630},{"style":628},[2631],{"type":230,"value":2632}," defaultSummary",{"type":225,"tag":266,"props":2634,"children":2635},{"style":279},[2636],{"type":230,"value":853},{"type":225,"tag":266,"props":2638,"children":2639},{"style":279},[2640],{"type":230,"value":858},{"type":225,"tag":266,"props":2642,"children":2643},{"style":412},[2644],{"type":230,"value":1898},{"type":225,"tag":266,"props":2646,"children":2647},{"style":279},[2648],{"type":230,"value":658},{"type":225,"tag":266,"props":2650,"children":2651},{"style":279},[2652],{"type":230,"value":481},{"type":225,"tag":266,"props":2654,"children":2655},{"style":279},[2656],{"type":230,"value":1616},{"type":225,"tag":266,"props":2658,"children":2659},{"class":268,"line":418},[2660,2665],{"type":225,"tag":266,"props":2661,"children":2662},{"style":273},[2663],{"type":230,"value":2664},"    temperature ",{"type":225,"tag":266,"props":2666,"children":2667},{"style":432},[2668],{"type":230,"value":1629},{"type":225,"tag":266,"props":2670,"children":2671},{"class":268,"line":428},[2672],{"type":225,"tag":266,"props":2673,"children":2674},{"style":279},[2675],{"type":230,"value":786},{"type":225,"tag":266,"props":2677,"children":2678},{"class":268,"line":443},[2679,2684,2688,2692,2696,2700,2704],{"type":225,"tag":266,"props":2680,"children":2681},{"style":279},[2682],{"type":230,"value":2683},"        \u003C",{"type":225,"tag":266,"props":2685,"children":2686},{"style":290},[2687],{"type":230,"value":1650},{"type":225,"tag":266,"props":2689,"children":2690},{"style":279},[2691],{"type":230,"value":1655},{"type":225,"tag":266,"props":2693,"children":2694},{"style":279},[2695],{"type":230,"value":858},{"type":225,"tag":266,"props":2697,"children":2698},{"style":412},[2699],{"type":230,"value":1664},{"type":225,"tag":266,"props":2701,"children":2702},{"style":279},[2703],{"type":230,"value":658},{"type":225,"tag":266,"props":2705,"children":2706},{"style":279},[2707],{"type":230,"value":1673},{"type":225,"tag":266,"props":2709,"children":2710},{"class":268,"line":712},[2711,2716,2720,2724,2728,2732,2736,2740,2744,2748],{"type":225,"tag":266,"props":2712,"children":2713},{"style":279},[2714],{"type":230,"value":2715},"        >=",{"type":225,"tag":266,"props":2717,"children":2718},{"style":290},[2719],{"type":230,"value":1650},{"type":225,"tag":266,"props":2721,"children":2722},{"style":279},[2723],{"type":230,"value":1691},{"type":225,"tag":266,"props":2725,"children":2726},{"style":279},[2727],{"type":230,"value":1696},{"type":225,"tag":266,"props":2729,"children":2730},{"style":290},[2731],{"type":230,"value":1701},{"type":225,"tag":266,"props":2733,"children":2734},{"style":279},[2735],{"type":230,"value":1655},{"type":225,"tag":266,"props":2737,"children":2738},{"style":279},[2739],{"type":230,"value":858},{"type":225,"tag":266,"props":2741,"children":2742},{"style":412},[2743],{"type":230,"value":1714},{"type":225,"tag":266,"props":2745,"children":2746},{"style":279},[2747],{"type":230,"value":658},{"type":225,"tag":266,"props":2749,"children":2750},{"style":279},[2751],{"type":230,"value":1673},{"type":225,"tag":266,"props":2753,"children":2754},{"class":268,"line":741},[2755,2759,2763,2767,2771,2775,2779,2783,2787,2791],{"type":225,"tag":266,"props":2756,"children":2757},{"style":279},[2758],{"type":230,"value":2715},{"type":225,"tag":266,"props":2760,"children":2761},{"style":290},[2762],{"type":230,"value":1701},{"type":225,"tag":266,"props":2764,"children":2765},{"style":279},[2766],{"type":230,"value":1691},{"type":225,"tag":266,"props":2768,"children":2769},{"style":279},[2770],{"type":230,"value":1696},{"type":225,"tag":266,"props":2772,"children":2773},{"style":290},[2774],{"type":230,"value":1747},{"type":225,"tag":266,"props":2776,"children":2777},{"style":279},[2778],{"type":230,"value":1655},{"type":225,"tag":266,"props":2780,"children":2781},{"style":279},[2782],{"type":230,"value":858},{"type":225,"tag":266,"props":2784,"children":2785},{"style":412},[2786],{"type":230,"value":1760},{"type":225,"tag":266,"props":2788,"children":2789},{"style":279},[2790],{"type":230,"value":658},{"type":225,"tag":266,"props":2792,"children":2793},{"style":279},[2794],{"type":230,"value":1673},{"type":225,"tag":266,"props":2796,"children":2797},{"class":268,"line":749},[2798,2802,2806,2810,2814,2818,2822,2826,2830,2834],{"type":225,"tag":266,"props":2799,"children":2800},{"style":279},[2801],{"type":230,"value":2715},{"type":225,"tag":266,"props":2803,"children":2804},{"style":290},[2805],{"type":230,"value":1747},{"type":225,"tag":266,"props":2807,"children":2808},{"style":279},[2809],{"type":230,"value":1691},{"type":225,"tag":266,"props":2811,"children":2812},{"style":279},[2813],{"type":230,"value":1696},{"type":225,"tag":266,"props":2815,"children":2816},{"style":290},[2817],{"type":230,"value":1793},{"type":225,"tag":266,"props":2819,"children":2820},{"style":279},[2821],{"type":230,"value":1655},{"type":225,"tag":266,"props":2823,"children":2824},{"style":279},[2825],{"type":230,"value":858},{"type":225,"tag":266,"props":2827,"children":2828},{"style":412},[2829],{"type":230,"value":1806},{"type":225,"tag":266,"props":2831,"children":2832},{"style":279},[2833],{"type":230,"value":658},{"type":225,"tag":266,"props":2835,"children":2836},{"style":279},[2837],{"type":230,"value":1673},{"type":225,"tag":266,"props":2839,"children":2840},{"class":268,"line":780},[2841,2845,2849,2853,2857,2861,2865,2869,2873,2877],{"type":225,"tag":266,"props":2842,"children":2843},{"style":279},[2844],{"type":230,"value":2715},{"type":225,"tag":266,"props":2846,"children":2847},{"style":290},[2848],{"type":230,"value":1793},{"type":225,"tag":266,"props":2850,"children":2851},{"style":279},[2852],{"type":230,"value":1691},{"type":225,"tag":266,"props":2854,"children":2855},{"style":279},[2856],{"type":230,"value":1696},{"type":225,"tag":266,"props":2858,"children":2859},{"style":290},[2860],{"type":230,"value":1839},{"type":225,"tag":266,"props":2862,"children":2863},{"style":279},[2864],{"type":230,"value":1655},{"type":225,"tag":266,"props":2866,"children":2867},{"style":279},[2868],{"type":230,"value":858},{"type":225,"tag":266,"props":2870,"children":2871},{"style":412},[2872],{"type":230,"value":1852},{"type":225,"tag":266,"props":2874,"children":2875},{"style":279},[2876],{"type":230,"value":658},{"type":225,"tag":266,"props":2878,"children":2879},{"style":279},[2880],{"type":230,"value":1673},{"type":225,"tag":266,"props":2882,"children":2883},{"class":268,"line":789},[2884,2888,2892,2896,2900,2904,2908,2912,2916,2920],{"type":225,"tag":266,"props":2885,"children":2886},{"style":279},[2887],{"type":230,"value":2715},{"type":225,"tag":266,"props":2889,"children":2890},{"style":290},[2891],{"type":230,"value":1839},{"type":225,"tag":266,"props":2893,"children":2894},{"style":279},[2895],{"type":230,"value":1691},{"type":225,"tag":266,"props":2897,"children":2898},{"style":279},[2899],{"type":230,"value":1696},{"type":225,"tag":266,"props":2901,"children":2902},{"style":290},[2903],{"type":230,"value":1885},{"type":225,"tag":266,"props":2905,"children":2906},{"style":279},[2907],{"type":230,"value":1655},{"type":225,"tag":266,"props":2909,"children":2910},{"style":279},[2911],{"type":230,"value":858},{"type":225,"tag":266,"props":2913,"children":2914},{"style":412},[2915],{"type":230,"value":1898},{"type":225,"tag":266,"props":2917,"children":2918},{"style":279},[2919],{"type":230,"value":658},{"type":225,"tag":266,"props":2921,"children":2922},{"style":279},[2923],{"type":230,"value":1673},{"type":225,"tag":266,"props":2925,"children":2926},{"class":268,"line":811},[2927,2931,2935,2939,2943,2947,2951,2955,2959,2963],{"type":225,"tag":266,"props":2928,"children":2929},{"style":279},[2930],{"type":230,"value":2715},{"type":225,"tag":266,"props":2932,"children":2933},{"style":290},[2934],{"type":230,"value":1885},{"type":225,"tag":266,"props":2936,"children":2937},{"style":279},[2938],{"type":230,"value":1691},{"type":225,"tag":266,"props":2940,"children":2941},{"style":279},[2942],{"type":230,"value":1696},{"type":225,"tag":266,"props":2944,"children":2945},{"style":290},[2946],{"type":230,"value":1931},{"type":225,"tag":266,"props":2948,"children":2949},{"style":279},[2950],{"type":230,"value":1655},{"type":225,"tag":266,"props":2952,"children":2953},{"style":279},[2954],{"type":230,"value":858},{"type":225,"tag":266,"props":2956,"children":2957},{"style":412},[2958],{"type":230,"value":1944},{"type":225,"tag":266,"props":2960,"children":2961},{"style":279},[2962],{"type":230,"value":658},{"type":225,"tag":266,"props":2964,"children":2965},{"style":279},[2966],{"type":230,"value":1673},{"type":225,"tag":266,"props":2968,"children":2969},{"class":268,"line":820},[2970,2974,2978,2982,2986,2990,2994,2998,3002,3006],{"type":225,"tag":266,"props":2971,"children":2972},{"style":279},[2973],{"type":230,"value":2715},{"type":225,"tag":266,"props":2975,"children":2976},{"style":290},[2977],{"type":230,"value":1931},{"type":225,"tag":266,"props":2979,"children":2980},{"style":279},[2981],{"type":230,"value":1691},{"type":225,"tag":266,"props":2983,"children":2984},{"style":279},[2985],{"type":230,"value":1696},{"type":225,"tag":266,"props":2987,"children":2988},{"style":290},[2989],{"type":230,"value":1977},{"type":225,"tag":266,"props":2991,"children":2992},{"style":279},[2993],{"type":230,"value":1655},{"type":225,"tag":266,"props":2995,"children":2996},{"style":279},[2997],{"type":230,"value":858},{"type":225,"tag":266,"props":2999,"children":3000},{"style":412},[3001],{"type":230,"value":1990},{"type":225,"tag":266,"props":3003,"children":3004},{"style":279},[3005],{"type":230,"value":658},{"type":225,"tag":266,"props":3007,"children":3008},{"style":279},[3009],{"type":230,"value":1673},{"type":225,"tag":266,"props":3011,"children":3012},{"class":268,"line":828},[3013,3017,3021,3025,3029,3033,3037,3041,3045,3049],{"type":225,"tag":266,"props":3014,"children":3015},{"style":279},[3016],{"type":230,"value":2715},{"type":225,"tag":266,"props":3018,"children":3019},{"style":290},[3020],{"type":230,"value":1977},{"type":225,"tag":266,"props":3022,"children":3023},{"style":279},[3024],{"type":230,"value":1691},{"type":225,"tag":266,"props":3026,"children":3027},{"style":279},[3028],{"type":230,"value":1696},{"type":225,"tag":266,"props":3030,"children":3031},{"style":290},[3032],{"type":230,"value":2023},{"type":225,"tag":266,"props":3034,"children":3035},{"style":279},[3036],{"type":230,"value":1655},{"type":225,"tag":266,"props":3038,"children":3039},{"style":279},[3040],{"type":230,"value":858},{"type":225,"tag":266,"props":3042,"children":3043},{"style":412},[3044],{"type":230,"value":2036},{"type":225,"tag":266,"props":3046,"children":3047},{"style":279},[3048],{"type":230,"value":658},{"type":225,"tag":266,"props":3050,"children":3051},{"style":279},[3052],{"type":230,"value":1673},{"type":225,"tag":266,"props":3054,"children":3055},{"class":268,"line":874},[3056,3060,3064,3068,3072,3076,3080],{"type":225,"tag":266,"props":3057,"children":3058},{"style":279},[3059],{"type":230,"value":2715},{"type":225,"tag":266,"props":3061,"children":3062},{"style":290},[3063],{"type":230,"value":2023},{"type":225,"tag":266,"props":3065,"children":3066},{"style":279},[3067],{"type":230,"value":1655},{"type":225,"tag":266,"props":3069,"children":3070},{"style":279},[3071],{"type":230,"value":858},{"type":225,"tag":266,"props":3073,"children":3074},{"style":412},[3075],{"type":230,"value":2069},{"type":225,"tag":266,"props":3077,"children":3078},{"style":279},[3079],{"type":230,"value":658},{"type":225,"tag":266,"props":3081,"children":3082},{"style":279},[3083],{"type":230,"value":1673},{"type":225,"tag":266,"props":3085,"children":3086},{"class":268,"line":920},[3087,3092,3096],{"type":225,"tag":266,"props":3088,"children":3089},{"style":273},[3090],{"type":230,"value":3091},"        _ ",{"type":225,"tag":266,"props":3093,"children":3094},{"style":279},[3095],{"type":230,"value":2091},{"type":225,"tag":266,"props":3097,"children":3098},{"style":273},[3099],{"type":230,"value":3100}," defaultSummary\n",{"type":225,"tag":266,"props":3102,"children":3103},{"class":268,"line":957},[3104],{"type":225,"tag":266,"props":3105,"children":3106},{"style":279},[3107],{"type":230,"value":3108},"    };\n",{"type":225,"tag":226,"props":3110,"children":3111},{},[3112,3117],{"type":225,"tag":262,"props":3113,"children":3115},{"className":3114},[],[3116],{"type":230,"value":1217},{"type":230,"value":3118}," does not have this logic because Summaries are randomly selected from an array containing possible summaries.",{"type":225,"tag":255,"props":3120,"children":3122},{"className":612,"code":3121,"language":216,"meta":207,"style":207},"private static readonly string[] Summaries = new [] { \"Freezing\", \"Bracing\", \"Chilly\", \"Cool\", \"Mild\", \"Warm\", \"Balmy\", \"Hot\", \"Sweltering\", \"Scorching\" };\n",[3123],{"type":225,"tag":262,"props":3124,"children":3125},{"__ignoreMap":207},[3126],{"type":225,"tag":266,"props":3127,"children":3128},{"class":268,"line":269},[3129,3134,3138,3142,3146,3151,3156,3160,3165,3170,3175,3179,3183,3187,3191,3195,3199,3203,3207,3211,3215,3219,3223,3227,3231,3235,3239,3243,3247,3251,3255,3259,3263,3267,3271,3275,3279,3283,3287,3291,3295,3299,3303,3307,3311,3315,3319,3323,3327,3331],{"type":225,"tag":266,"props":3130,"children":3131},{"style":678},[3132],{"type":230,"value":3133},"private",{"type":225,"tag":266,"props":3135,"children":3136},{"style":678},[3137],{"type":230,"value":1310},{"type":225,"tag":266,"props":3139,"children":3140},{"style":678},[3141],{"type":230,"value":723},{"type":225,"tag":266,"props":3143,"children":3144},{"style":279},[3145],{"type":230,"value":2627},{"type":225,"tag":266,"props":3147,"children":3148},{"style":279},[3149],{"type":230,"value":3150},"[]",{"type":225,"tag":266,"props":3152,"children":3153},{"style":628},[3154],{"type":230,"value":3155}," Summaries",{"type":225,"tag":266,"props":3157,"children":3158},{"style":279},[3159],{"type":230,"value":853},{"type":225,"tag":266,"props":3161,"children":3162},{"style":279},[3163],{"type":230,"value":3164}," new",{"type":225,"tag":266,"props":3166,"children":3167},{"style":279},[3168],{"type":230,"value":3169}," []",{"type":225,"tag":266,"props":3171,"children":3172},{"style":279},[3173],{"type":230,"value":3174}," {",{"type":225,"tag":266,"props":3176,"children":3177},{"style":279},[3178],{"type":230,"value":858},{"type":225,"tag":266,"props":3180,"children":3181},{"style":412},[3182],{"type":230,"value":1664},{"type":225,"tag":266,"props":3184,"children":3185},{"style":279},[3186],{"type":230,"value":658},{"type":225,"tag":266,"props":3188,"children":3189},{"style":279},[3190],{"type":230,"value":1329},{"type":225,"tag":266,"props":3192,"children":3193},{"style":279},[3194],{"type":230,"value":858},{"type":225,"tag":266,"props":3196,"children":3197},{"style":412},[3198],{"type":230,"value":1714},{"type":225,"tag":266,"props":3200,"children":3201},{"style":279},[3202],{"type":230,"value":658},{"type":225,"tag":266,"props":3204,"children":3205},{"style":279},[3206],{"type":230,"value":1329},{"type":225,"tag":266,"props":3208,"children":3209},{"style":279},[3210],{"type":230,"value":858},{"type":225,"tag":266,"props":3212,"children":3213},{"style":412},[3214],{"type":230,"value":1760},{"type":225,"tag":266,"props":3216,"children":3217},{"style":279},[3218],{"type":230,"value":658},{"type":225,"tag":266,"props":3220,"children":3221},{"style":279},[3222],{"type":230,"value":1329},{"type":225,"tag":266,"props":3224,"children":3225},{"style":279},[3226],{"type":230,"value":858},{"type":225,"tag":266,"props":3228,"children":3229},{"style":412},[3230],{"type":230,"value":1806},{"type":225,"tag":266,"props":3232,"children":3233},{"style":279},[3234],{"type":230,"value":658},{"type":225,"tag":266,"props":3236,"children":3237},{"style":279},[3238],{"type":230,"value":1329},{"type":225,"tag":266,"props":3240,"children":3241},{"style":279},[3242],{"type":230,"value":858},{"type":225,"tag":266,"props":3244,"children":3245},{"style":412},[3246],{"type":230,"value":1852},{"type":225,"tag":266,"props":3248,"children":3249},{"style":279},[3250],{"type":230,"value":658},{"type":225,"tag":266,"props":3252,"children":3253},{"style":279},[3254],{"type":230,"value":1329},{"type":225,"tag":266,"props":3256,"children":3257},{"style":279},[3258],{"type":230,"value":858},{"type":225,"tag":266,"props":3260,"children":3261},{"style":412},[3262],{"type":230,"value":1898},{"type":225,"tag":266,"props":3264,"children":3265},{"style":279},[3266],{"type":230,"value":658},{"type":225,"tag":266,"props":3268,"children":3269},{"style":279},[3270],{"type":230,"value":1329},{"type":225,"tag":266,"props":3272,"children":3273},{"style":279},[3274],{"type":230,"value":858},{"type":225,"tag":266,"props":3276,"children":3277},{"style":412},[3278],{"type":230,"value":1944},{"type":225,"tag":266,"props":3280,"children":3281},{"style":279},[3282],{"type":230,"value":658},{"type":225,"tag":266,"props":3284,"children":3285},{"style":279},[3286],{"type":230,"value":1329},{"type":225,"tag":266,"props":3288,"children":3289},{"style":279},[3290],{"type":230,"value":858},{"type":225,"tag":266,"props":3292,"children":3293},{"style":412},[3294],{"type":230,"value":1990},{"type":225,"tag":266,"props":3296,"children":3297},{"style":279},[3298],{"type":230,"value":658},{"type":225,"tag":266,"props":3300,"children":3301},{"style":279},[3302],{"type":230,"value":1329},{"type":225,"tag":266,"props":3304,"children":3305},{"style":279},[3306],{"type":230,"value":858},{"type":225,"tag":266,"props":3308,"children":3309},{"style":412},[3310],{"type":230,"value":2036},{"type":225,"tag":266,"props":3312,"children":3313},{"style":279},[3314],{"type":230,"value":658},{"type":225,"tag":266,"props":3316,"children":3317},{"style":279},[3318],{"type":230,"value":1329},{"type":225,"tag":266,"props":3320,"children":3321},{"style":279},[3322],{"type":230,"value":858},{"type":225,"tag":266,"props":3324,"children":3325},{"style":412},[3326],{"type":230,"value":2069},{"type":225,"tag":266,"props":3328,"children":3329},{"style":279},[3330],{"type":230,"value":658},{"type":225,"tag":266,"props":3332,"children":3333},{"style":279},[3334],{"type":230,"value":3335}," };\n",{"type":225,"tag":226,"props":3337,"children":3338},{},[3339,3341,3348],{"type":230,"value":3340},"With ",{"type":225,"tag":244,"props":3342,"children":3345},{"href":3343,"rel":3344},"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#collection-expressions",[248],[3346],{"type":230,"value":3347},"collection expressions",{"type":230,"value":3349},", this array can be defined directly with square brackets.",{"type":225,"tag":255,"props":3351,"children":3353},{"className":612,"code":3352,"language":216,"meta":207,"style":207},"private static readonly string[] Summaries = [ \"Freezing\", \"Bracing\", \"Chilly\", \"Cool\", \"Mild\", \"Warm\", \"Balmy\", \"Hot\", \"Sweltering\", \"Scorching\"];\n",[3354],{"type":225,"tag":262,"props":3355,"children":3356},{"__ignoreMap":207},[3357],{"type":225,"tag":266,"props":3358,"children":3359},{"class":268,"line":269},[3360,3364,3368,3372,3376,3380,3384,3388,3393,3397,3401,3405,3409,3413,3417,3421,3425,3429,3433,3437,3441,3445,3449,3453,3457,3461,3465,3469,3473,3477,3481,3485,3489,3493,3497,3501,3505,3509,3513,3517,3521,3525,3529,3533,3537,3541,3545,3549],{"type":225,"tag":266,"props":3361,"children":3362},{"style":678},[3363],{"type":230,"value":3133},{"type":225,"tag":266,"props":3365,"children":3366},{"style":678},[3367],{"type":230,"value":1310},{"type":225,"tag":266,"props":3369,"children":3370},{"style":678},[3371],{"type":230,"value":723},{"type":225,"tag":266,"props":3373,"children":3374},{"style":279},[3375],{"type":230,"value":2627},{"type":225,"tag":266,"props":3377,"children":3378},{"style":279},[3379],{"type":230,"value":3150},{"type":225,"tag":266,"props":3381,"children":3382},{"style":628},[3383],{"type":230,"value":3155},{"type":225,"tag":266,"props":3385,"children":3386},{"style":279},[3387],{"type":230,"value":853},{"type":225,"tag":266,"props":3389,"children":3390},{"style":279},[3391],{"type":230,"value":3392}," [",{"type":225,"tag":266,"props":3394,"children":3395},{"style":279},[3396],{"type":230,"value":858},{"type":225,"tag":266,"props":3398,"children":3399},{"style":412},[3400],{"type":230,"value":1664},{"type":225,"tag":266,"props":3402,"children":3403},{"style":279},[3404],{"type":230,"value":658},{"type":225,"tag":266,"props":3406,"children":3407},{"style":279},[3408],{"type":230,"value":1329},{"type":225,"tag":266,"props":3410,"children":3411},{"style":279},[3412],{"type":230,"value":858},{"type":225,"tag":266,"props":3414,"children":3415},{"style":412},[3416],{"type":230,"value":1714},{"type":225,"tag":266,"props":3418,"children":3419},{"style":279},[3420],{"type":230,"value":658},{"type":225,"tag":266,"props":3422,"children":3423},{"style":279},[3424],{"type":230,"value":1329},{"type":225,"tag":266,"props":3426,"children":3427},{"style":279},[3428],{"type":230,"value":858},{"type":225,"tag":266,"props":3430,"children":3431},{"style":412},[3432],{"type":230,"value":1760},{"type":225,"tag":266,"props":3434,"children":3435},{"style":279},[3436],{"type":230,"value":658},{"type":225,"tag":266,"props":3438,"children":3439},{"style":279},[3440],{"type":230,"value":1329},{"type":225,"tag":266,"props":3442,"children":3443},{"style":279},[3444],{"type":230,"value":858},{"type":225,"tag":266,"props":3446,"children":3447},{"style":412},[3448],{"type":230,"value":1806},{"type":225,"tag":266,"props":3450,"children":3451},{"style":279},[3452],{"type":230,"value":658},{"type":225,"tag":266,"props":3454,"children":3455},{"style":279},[3456],{"type":230,"value":1329},{"type":225,"tag":266,"props":3458,"children":3459},{"style":279},[3460],{"type":230,"value":858},{"type":225,"tag":266,"props":3462,"children":3463},{"style":412},[3464],{"type":230,"value":1852},{"type":225,"tag":266,"props":3466,"children":3467},{"style":279},[3468],{"type":230,"value":658},{"type":225,"tag":266,"props":3470,"children":3471},{"style":279},[3472],{"type":230,"value":1329},{"type":225,"tag":266,"props":3474,"children":3475},{"style":279},[3476],{"type":230,"value":858},{"type":225,"tag":266,"props":3478,"children":3479},{"style":412},[3480],{"type":230,"value":1898},{"type":225,"tag":266,"props":3482,"children":3483},{"style":279},[3484],{"type":230,"value":658},{"type":225,"tag":266,"props":3486,"children":3487},{"style":279},[3488],{"type":230,"value":1329},{"type":225,"tag":266,"props":3490,"children":3491},{"style":279},[3492],{"type":230,"value":858},{"type":225,"tag":266,"props":3494,"children":3495},{"style":412},[3496],{"type":230,"value":1944},{"type":225,"tag":266,"props":3498,"children":3499},{"style":279},[3500],{"type":230,"value":658},{"type":225,"tag":266,"props":3502,"children":3503},{"style":279},[3504],{"type":230,"value":1329},{"type":225,"tag":266,"props":3506,"children":3507},{"style":279},[3508],{"type":230,"value":858},{"type":225,"tag":266,"props":3510,"children":3511},{"style":412},[3512],{"type":230,"value":1990},{"type":225,"tag":266,"props":3514,"children":3515},{"style":279},[3516],{"type":230,"value":658},{"type":225,"tag":266,"props":3518,"children":3519},{"style":279},[3520],{"type":230,"value":1329},{"type":225,"tag":266,"props":3522,"children":3523},{"style":279},[3524],{"type":230,"value":858},{"type":225,"tag":266,"props":3526,"children":3527},{"style":412},[3528],{"type":230,"value":2036},{"type":225,"tag":266,"props":3530,"children":3531},{"style":279},[3532],{"type":230,"value":658},{"type":225,"tag":266,"props":3534,"children":3535},{"style":279},[3536],{"type":230,"value":1329},{"type":225,"tag":266,"props":3538,"children":3539},{"style":279},[3540],{"type":230,"value":858},{"type":225,"tag":266,"props":3542,"children":3543},{"style":412},[3544],{"type":230,"value":2069},{"type":225,"tag":266,"props":3546,"children":3547},{"style":279},[3548],{"type":230,"value":658},{"type":225,"tag":266,"props":3550,"children":3551},{"style":279},[3552],{"type":230,"value":3553},"];\n",{"type":225,"tag":226,"props":3555,"children":3556},{},[3557],{"type":230,"value":3558},"It would work with other types of collections as well. If we needed to have another list containing only cold summaries and avoid duplication between the two lists, we could also define the two lists and use the spread operator.",{"type":225,"tag":255,"props":3560,"children":3562},{"className":612,"code":3561,"language":216,"meta":207,"style":207}," private static readonly IList\u003Cstring> ColdAdjectives = [\"Freezing\", \"Bracing\", \"Chilly\", \"Cool\"];\n private static readonly string[] Summaries = [ ..ColdAdjectives, \"Mild\", \"Warm\", \"Balmy\", \"Hot\", \"Sweltering\", \"Scorching\"];\n",[3563],{"type":225,"tag":262,"props":3564,"children":3565},{"__ignoreMap":207},[3566,3677],{"type":225,"tag":266,"props":3567,"children":3568},{"class":268,"line":269},[3569,3574,3578,3582,3587,3591,3596,3600,3605,3609,3613,3617,3621,3625,3629,3633,3637,3641,3645,3649,3653,3657,3661,3665,3669,3673],{"type":225,"tag":266,"props":3570,"children":3571},{"style":678},[3572],{"type":230,"value":3573}," private",{"type":225,"tag":266,"props":3575,"children":3576},{"style":678},[3577],{"type":230,"value":1310},{"type":225,"tag":266,"props":3579,"children":3580},{"style":678},[3581],{"type":230,"value":723},{"type":225,"tag":266,"props":3583,"children":3584},{"style":628},[3585],{"type":230,"value":3586}," IList",{"type":225,"tag":266,"props":3588,"children":3589},{"style":279},[3590],{"type":230,"value":935},{"type":225,"tag":266,"props":3592,"children":3593},{"style":279},[3594],{"type":230,"value":3595},"string",{"type":225,"tag":266,"props":3597,"children":3598},{"style":279},[3599],{"type":230,"value":1104},{"type":225,"tag":266,"props":3601,"children":3602},{"style":628},[3603],{"type":230,"value":3604}," ColdAdjectives",{"type":225,"tag":266,"props":3606,"children":3607},{"style":279},[3608],{"type":230,"value":853},{"type":225,"tag":266,"props":3610,"children":3611},{"style":279},[3612],{"type":230,"value":3392},{"type":225,"tag":266,"props":3614,"children":3615},{"style":279},[3616],{"type":230,"value":658},{"type":225,"tag":266,"props":3618,"children":3619},{"style":412},[3620],{"type":230,"value":1664},{"type":225,"tag":266,"props":3622,"children":3623},{"style":279},[3624],{"type":230,"value":658},{"type":225,"tag":266,"props":3626,"children":3627},{"style":279},[3628],{"type":230,"value":1329},{"type":225,"tag":266,"props":3630,"children":3631},{"style":279},[3632],{"type":230,"value":858},{"type":225,"tag":266,"props":3634,"children":3635},{"style":412},[3636],{"type":230,"value":1714},{"type":225,"tag":266,"props":3638,"children":3639},{"style":279},[3640],{"type":230,"value":658},{"type":225,"tag":266,"props":3642,"children":3643},{"style":279},[3644],{"type":230,"value":1329},{"type":225,"tag":266,"props":3646,"children":3647},{"style":279},[3648],{"type":230,"value":858},{"type":225,"tag":266,"props":3650,"children":3651},{"style":412},[3652],{"type":230,"value":1760},{"type":225,"tag":266,"props":3654,"children":3655},{"style":279},[3656],{"type":230,"value":658},{"type":225,"tag":266,"props":3658,"children":3659},{"style":279},[3660],{"type":230,"value":1329},{"type":225,"tag":266,"props":3662,"children":3663},{"style":279},[3664],{"type":230,"value":858},{"type":225,"tag":266,"props":3666,"children":3667},{"style":412},[3668],{"type":230,"value":1806},{"type":225,"tag":266,"props":3670,"children":3671},{"style":279},[3672],{"type":230,"value":658},{"type":225,"tag":266,"props":3674,"children":3675},{"style":279},[3676],{"type":230,"value":3553},{"type":225,"tag":266,"props":3678,"children":3679},{"class":268,"line":418},[3680,3684,3688,3692,3696,3700,3704,3708,3712,3717,3722,3726,3730,3734,3738,3742,3746,3750,3754,3758,3762,3766,3770,3774,3778,3782,3786,3790,3794,3798,3802,3806,3810,3814,3818],{"type":225,"tag":266,"props":3681,"children":3682},{"style":678},[3683],{"type":230,"value":3573},{"type":225,"tag":266,"props":3685,"children":3686},{"style":678},[3687],{"type":230,"value":1310},{"type":225,"tag":266,"props":3689,"children":3690},{"style":678},[3691],{"type":230,"value":723},{"type":225,"tag":266,"props":3693,"children":3694},{"style":279},[3695],{"type":230,"value":2627},{"type":225,"tag":266,"props":3697,"children":3698},{"style":279},[3699],{"type":230,"value":3150},{"type":225,"tag":266,"props":3701,"children":3702},{"style":628},[3703],{"type":230,"value":3155},{"type":225,"tag":266,"props":3705,"children":3706},{"style":279},[3707],{"type":230,"value":853},{"type":225,"tag":266,"props":3709,"children":3710},{"style":279},[3711],{"type":230,"value":3392},{"type":225,"tag":266,"props":3713,"children":3714},{"style":279},[3715],{"type":230,"value":3716}," ..",{"type":225,"tag":266,"props":3718,"children":3719},{"style":273},[3720],{"type":230,"value":3721},"ColdAdjectives",{"type":225,"tag":266,"props":3723,"children":3724},{"style":279},[3725],{"type":230,"value":1329},{"type":225,"tag":266,"props":3727,"children":3728},{"style":279},[3729],{"type":230,"value":858},{"type":225,"tag":266,"props":3731,"children":3732},{"style":412},[3733],{"type":230,"value":1852},{"type":225,"tag":266,"props":3735,"children":3736},{"style":279},[3737],{"type":230,"value":658},{"type":225,"tag":266,"props":3739,"children":3740},{"style":279},[3741],{"type":230,"value":1329},{"type":225,"tag":266,"props":3743,"children":3744},{"style":279},[3745],{"type":230,"value":858},{"type":225,"tag":266,"props":3747,"children":3748},{"style":412},[3749],{"type":230,"value":1898},{"type":225,"tag":266,"props":3751,"children":3752},{"style":279},[3753],{"type":230,"value":658},{"type":225,"tag":266,"props":3755,"children":3756},{"style":279},[3757],{"type":230,"value":1329},{"type":225,"tag":266,"props":3759,"children":3760},{"style":279},[3761],{"type":230,"value":858},{"type":225,"tag":266,"props":3763,"children":3764},{"style":412},[3765],{"type":230,"value":1944},{"type":225,"tag":266,"props":3767,"children":3768},{"style":279},[3769],{"type":230,"value":658},{"type":225,"tag":266,"props":3771,"children":3772},{"style":279},[3773],{"type":230,"value":1329},{"type":225,"tag":266,"props":3775,"children":3776},{"style":279},[3777],{"type":230,"value":858},{"type":225,"tag":266,"props":3779,"children":3780},{"style":412},[3781],{"type":230,"value":1990},{"type":225,"tag":266,"props":3783,"children":3784},{"style":279},[3785],{"type":230,"value":658},{"type":225,"tag":266,"props":3787,"children":3788},{"style":279},[3789],{"type":230,"value":1329},{"type":225,"tag":266,"props":3791,"children":3792},{"style":279},[3793],{"type":230,"value":858},{"type":225,"tag":266,"props":3795,"children":3796},{"style":412},[3797],{"type":230,"value":2036},{"type":225,"tag":266,"props":3799,"children":3800},{"style":279},[3801],{"type":230,"value":658},{"type":225,"tag":266,"props":3803,"children":3804},{"style":279},[3805],{"type":230,"value":1329},{"type":225,"tag":266,"props":3807,"children":3808},{"style":279},[3809],{"type":230,"value":858},{"type":225,"tag":266,"props":3811,"children":3812},{"style":412},[3813],{"type":230,"value":2069},{"type":225,"tag":266,"props":3815,"children":3816},{"style":279},[3817],{"type":230,"value":658},{"type":225,"tag":266,"props":3819,"children":3820},{"style":279},[3821],{"type":230,"value":3553},{"type":225,"tag":226,"props":3823,"children":3824},{},[3825],{"type":230,"value":3826},"The last C# 12 thing we could do in this example is to take advantage of the new class (and structs) primary constructors that were previously limited to records.",{"type":225,"tag":226,"props":3828,"children":3829},{},[3830,3831,3836],{"type":230,"value":601},{"type":225,"tag":262,"props":3832,"children":3834},{"className":3833},[],[3835],{"type":230,"value":894},{"type":230,"value":3837}," class could become the following:",{"type":225,"tag":255,"props":3839,"children":3841},{"className":612,"code":3840,"language":216,"meta":207,"style":207},"namespace WeatherApi;\n\npublic class WeatherForecast(DateOnly date, int temperatureC, string? summary)\n{\n    public int TemperatureC { get; } = temperatureC;\n    \n    public DateOnly Date { get; } = date;\n    \n    public string? Summary { get; } = summary;\n    \n    public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);\n}\n",[3842],{"type":225,"tag":262,"props":3843,"children":3844},{"__ignoreMap":207},[3845,3862,3869,3935,3942,3989,3997,4041,4048,4096,4103,4157],{"type":225,"tag":266,"props":3846,"children":3847},{"class":268,"line":269},[3848,3853,3858],{"type":225,"tag":266,"props":3849,"children":3850},{"style":628},[3851],{"type":230,"value":3852},"namespace",{"type":225,"tag":266,"props":3854,"children":3855},{"style":273},[3856],{"type":230,"value":3857}," WeatherApi",{"type":225,"tag":266,"props":3859,"children":3860},{"style":279},[3861],{"type":230,"value":738},{"type":225,"tag":266,"props":3863,"children":3864},{"class":268,"line":418},[3865],{"type":225,"tag":266,"props":3866,"children":3867},{"emptyLinePlaceholder":422},[3868],{"type":230,"value":425},{"type":225,"tag":266,"props":3870,"children":3871},{"class":268,"line":428},[3872,3876,3880,3885,3889,3894,3899,3903,3908,3913,3917,3921,3926,3931],{"type":225,"tag":266,"props":3873,"children":3874},{"style":678},[3875],{"type":230,"value":681},{"type":225,"tag":266,"props":3877,"children":3878},{"style":628},[3879],{"type":230,"value":686},{"type":225,"tag":266,"props":3881,"children":3882},{"style":628},[3883],{"type":230,"value":3884}," WeatherForecast",{"type":225,"tag":266,"props":3886,"children":3887},{"style":279},[3888],{"type":230,"value":653},{"type":225,"tag":266,"props":3890,"children":3891},{"style":628},[3892],{"type":230,"value":3893},"DateOnly",{"type":225,"tag":266,"props":3895,"children":3896},{"style":628},[3897],{"type":230,"value":3898}," date",{"type":225,"tag":266,"props":3900,"children":3901},{"style":279},[3902],{"type":230,"value":1329},{"type":225,"tag":266,"props":3904,"children":3905},{"style":279},[3906],{"type":230,"value":3907}," int",{"type":225,"tag":266,"props":3909,"children":3910},{"style":628},[3911],{"type":230,"value":3912}," temperatureC",{"type":225,"tag":266,"props":3914,"children":3915},{"style":279},[3916],{"type":230,"value":1329},{"type":225,"tag":266,"props":3918,"children":3919},{"style":279},[3920],{"type":230,"value":2627},{"type":225,"tag":266,"props":3922,"children":3923},{"style":279},[3924],{"type":230,"value":3925},"?",{"type":225,"tag":266,"props":3927,"children":3928},{"style":628},[3929],{"type":230,"value":3930}," summary",{"type":225,"tag":266,"props":3932,"children":3933},{"style":279},[3934],{"type":230,"value":777},{"type":225,"tag":266,"props":3936,"children":3937},{"class":268,"line":443},[3938],{"type":225,"tag":266,"props":3939,"children":3940},{"style":279},[3941],{"type":230,"value":709},{"type":225,"tag":266,"props":3943,"children":3944},{"class":268,"line":712},[3945,3949,3953,3958,3962,3967,3972,3977,3981,3985],{"type":225,"tag":266,"props":3946,"children":3947},{"style":678},[3948],{"type":230,"value":755},{"type":225,"tag":266,"props":3950,"children":3951},{"style":279},[3952],{"type":230,"value":3907},{"type":225,"tag":266,"props":3954,"children":3955},{"style":628},[3956],{"type":230,"value":3957}," TemperatureC",{"type":225,"tag":266,"props":3959,"children":3960},{"style":279},[3961],{"type":230,"value":3174},{"type":225,"tag":266,"props":3963,"children":3964},{"style":628},[3965],{"type":230,"value":3966}," get",{"type":225,"tag":266,"props":3968,"children":3969},{"style":279},[3970],{"type":230,"value":3971},";",{"type":225,"tag":266,"props":3973,"children":3974},{"style":279},[3975],{"type":230,"value":3976}," }",{"type":225,"tag":266,"props":3978,"children":3979},{"style":279},[3980],{"type":230,"value":853},{"type":225,"tag":266,"props":3982,"children":3983},{"style":273},[3984],{"type":230,"value":3912},{"type":225,"tag":266,"props":3986,"children":3987},{"style":279},[3988],{"type":230,"value":738},{"type":225,"tag":266,"props":3990,"children":3991},{"class":268,"line":741},[3992],{"type":225,"tag":266,"props":3993,"children":3994},{"style":273},[3995],{"type":230,"value":3996},"    \n",{"type":225,"tag":266,"props":3998,"children":3999},{"class":268,"line":749},[4000,4004,4008,4013,4017,4021,4025,4029,4033,4037],{"type":225,"tag":266,"props":4001,"children":4002},{"style":678},[4003],{"type":230,"value":755},{"type":225,"tag":266,"props":4005,"children":4006},{"style":628},[4007],{"type":230,"value":2202},{"type":225,"tag":266,"props":4009,"children":4010},{"style":628},[4011],{"type":230,"value":4012}," Date",{"type":225,"tag":266,"props":4014,"children":4015},{"style":279},[4016],{"type":230,"value":3174},{"type":225,"tag":266,"props":4018,"children":4019},{"style":628},[4020],{"type":230,"value":3966},{"type":225,"tag":266,"props":4022,"children":4023},{"style":279},[4024],{"type":230,"value":3971},{"type":225,"tag":266,"props":4026,"children":4027},{"style":279},[4028],{"type":230,"value":3976},{"type":225,"tag":266,"props":4030,"children":4031},{"style":279},[4032],{"type":230,"value":853},{"type":225,"tag":266,"props":4034,"children":4035},{"style":273},[4036],{"type":230,"value":3898},{"type":225,"tag":266,"props":4038,"children":4039},{"style":279},[4040],{"type":230,"value":738},{"type":225,"tag":266,"props":4042,"children":4043},{"class":268,"line":780},[4044],{"type":225,"tag":266,"props":4045,"children":4046},{"style":273},[4047],{"type":230,"value":3996},{"type":225,"tag":266,"props":4049,"children":4050},{"class":268,"line":789},[4051,4055,4059,4063,4068,4072,4076,4080,4084,4088,4092],{"type":225,"tag":266,"props":4052,"children":4053},{"style":678},[4054],{"type":230,"value":755},{"type":225,"tag":266,"props":4056,"children":4057},{"style":279},[4058],{"type":230,"value":2627},{"type":225,"tag":266,"props":4060,"children":4061},{"style":279},[4062],{"type":230,"value":3925},{"type":225,"tag":266,"props":4064,"children":4065},{"style":628},[4066],{"type":230,"value":4067}," Summary",{"type":225,"tag":266,"props":4069,"children":4070},{"style":279},[4071],{"type":230,"value":3174},{"type":225,"tag":266,"props":4073,"children":4074},{"style":628},[4075],{"type":230,"value":3966},{"type":225,"tag":266,"props":4077,"children":4078},{"style":279},[4079],{"type":230,"value":3971},{"type":225,"tag":266,"props":4081,"children":4082},{"style":279},[4083],{"type":230,"value":3976},{"type":225,"tag":266,"props":4085,"children":4086},{"style":279},[4087],{"type":230,"value":853},{"type":225,"tag":266,"props":4089,"children":4090},{"style":273},[4091],{"type":230,"value":3930},{"type":225,"tag":266,"props":4093,"children":4094},{"style":279},[4095],{"type":230,"value":738},{"type":225,"tag":266,"props":4097,"children":4098},{"class":268,"line":811},[4099],{"type":225,"tag":266,"props":4100,"children":4101},{"style":273},[4102],{"type":230,"value":3996},{"type":225,"tag":266,"props":4104,"children":4105},{"class":268,"line":820},[4106,4110,4114,4119,4123,4128,4133,4138,4143,4148,4153],{"type":225,"tag":266,"props":4107,"children":4108},{"style":678},[4109],{"type":230,"value":755},{"type":225,"tag":266,"props":4111,"children":4112},{"style":279},[4113],{"type":230,"value":3907},{"type":225,"tag":266,"props":4115,"children":4116},{"style":628},[4117],{"type":230,"value":4118}," TemperatureF",{"type":225,"tag":266,"props":4120,"children":4121},{"style":279},[4122],{"type":230,"value":1655},{"type":225,"tag":266,"props":4124,"children":4125},{"style":290},[4126],{"type":230,"value":4127}," 32",{"type":225,"tag":266,"props":4129,"children":4130},{"style":279},[4131],{"type":230,"value":4132}," +",{"type":225,"tag":266,"props":4134,"children":4135},{"style":279},[4136],{"type":230,"value":4137}," (int)(",{"type":225,"tag":266,"props":4139,"children":4140},{"style":273},[4141],{"type":230,"value":4142},"TemperatureC ",{"type":225,"tag":266,"props":4144,"children":4145},{"style":279},[4146],{"type":230,"value":4147},"/",{"type":225,"tag":266,"props":4149,"children":4150},{"style":290},[4151],{"type":230,"value":4152}," 0.5556",{"type":225,"tag":266,"props":4154,"children":4155},{"style":279},[4156],{"type":230,"value":1380},{"type":225,"tag":266,"props":4158,"children":4159},{"class":268,"line":828},[4160],{"type":225,"tag":266,"props":4161,"children":4162},{"style":279},[4163],{"type":230,"value":1006},{"type":225,"tag":352,"props":4165,"children":4167},{"icon":4166},"i-heroicons-chat-bubble-left-20-solid",[4168],{"type":225,"tag":226,"props":4169,"children":4170},{},[4171],{"type":230,"value":4172},"I'm not sure this is completely relevant here, a record would probably be better but you get the idea.",{"type":225,"tag":226,"props":4174,"children":4175},{},[4176,4178,4184],{"type":230,"value":4177},"You can use primary constructors in any class, it will work as well with dependency injection. However, be aware that the services you used to assign to a private read-only field of your class won't be read-only anymore like ",{"type":225,"tag":262,"props":4179,"children":4181},{"className":4180},[],[4182],{"type":230,"value":4183},"weatherService",{"type":230,"value":4185}," in this example:",{"type":225,"tag":255,"props":4187,"children":4189},{"className":612,"code":4188,"language":216,"meta":207,"style":207},"public class WeatherForecastController(IWeatherService weatherService, ILogger\u003CWeatherForecastController> logger) : ControllerBase\n{\n    [HttpGet(Name = \"GetWeatherForecast\")]\n    [ProducesResponseType(typeof(WeatherForecast), StatusCodes.Status200OK)]\n    public Task\u003CWeatherForecast[]> Get()\n    {\n        return weatherService.GetWeatherForecasts();\n    }\n}\n",[4190],{"type":225,"tag":262,"props":4191,"children":4192},{"__ignoreMap":207},[4193,4258,4265,4304,4343,4374,4381,4404,4411],{"type":225,"tag":266,"props":4194,"children":4195},{"class":268,"line":269},[4196,4200,4204,4208,4212,4216,4220,4224,4229,4233,4237,4241,4246,4250,4254],{"type":225,"tag":266,"props":4197,"children":4198},{"style":678},[4199],{"type":230,"value":681},{"type":225,"tag":266,"props":4201,"children":4202},{"style":628},[4203],{"type":230,"value":686},{"type":225,"tag":266,"props":4205,"children":4206},{"style":628},[4207],{"type":230,"value":691},{"type":225,"tag":266,"props":4209,"children":4210},{"style":279},[4211],{"type":230,"value":653},{"type":225,"tag":266,"props":4213,"children":4214},{"style":628},[4215],{"type":230,"value":559},{"type":225,"tag":266,"props":4217,"children":4218},{"style":628},[4219],{"type":230,"value":772},{"type":225,"tag":266,"props":4221,"children":4222},{"style":279},[4223],{"type":230,"value":1329},{"type":225,"tag":266,"props":4225,"children":4226},{"style":628},[4227],{"type":230,"value":4228}," ILogger",{"type":225,"tag":266,"props":4230,"children":4231},{"style":279},[4232],{"type":230,"value":935},{"type":225,"tag":266,"props":4234,"children":4235},{"style":628},[4236],{"type":230,"value":607},{"type":225,"tag":266,"props":4238,"children":4239},{"style":279},[4240],{"type":230,"value":1104},{"type":225,"tag":266,"props":4242,"children":4243},{"style":628},[4244],{"type":230,"value":4245}," logger",{"type":225,"tag":266,"props":4247,"children":4248},{"style":279},[4249],{"type":230,"value":481},{"type":225,"tag":266,"props":4251,"children":4252},{"style":279},[4253],{"type":230,"value":696},{"type":225,"tag":266,"props":4255,"children":4256},{"style":628},[4257],{"type":230,"value":701},{"type":225,"tag":266,"props":4259,"children":4260},{"class":268,"line":418},[4261],{"type":225,"tag":266,"props":4262,"children":4263},{"style":279},[4264],{"type":230,"value":709},{"type":225,"tag":266,"props":4266,"children":4267},{"class":268,"line":428},[4268,4272,4276,4280,4284,4288,4292,4296,4300],{"type":225,"tag":266,"props":4269,"children":4270},{"style":279},[4271],{"type":230,"value":834},{"type":225,"tag":266,"props":4273,"children":4274},{"style":628},[4275],{"type":230,"value":839},{"type":225,"tag":266,"props":4277,"children":4278},{"style":279},[4279],{"type":230,"value":653},{"type":225,"tag":266,"props":4281,"children":4282},{"style":628},[4283],{"type":230,"value":848},{"type":225,"tag":266,"props":4285,"children":4286},{"style":279},[4287],{"type":230,"value":853},{"type":225,"tag":266,"props":4289,"children":4290},{"style":279},[4291],{"type":230,"value":858},{"type":225,"tag":266,"props":4293,"children":4294},{"style":412},[4295],{"type":230,"value":863},{"type":225,"tag":266,"props":4297,"children":4298},{"style":279},[4299],{"type":230,"value":658},{"type":225,"tag":266,"props":4301,"children":4302},{"style":279},[4303],{"type":230,"value":672},{"type":225,"tag":266,"props":4305,"children":4306},{"class":268,"line":443},[4307,4311,4315,4319,4323,4327,4331,4335,4339],{"type":225,"tag":266,"props":4308,"children":4309},{"style":279},[4310],{"type":230,"value":834},{"type":225,"tag":266,"props":4312,"children":4313},{"style":628},[4314],{"type":230,"value":884},{"type":225,"tag":266,"props":4316,"children":4317},{"style":279},[4318],{"type":230,"value":889},{"type":225,"tag":266,"props":4320,"children":4321},{"style":628},[4322],{"type":230,"value":894},{"type":225,"tag":266,"props":4324,"children":4325},{"style":279},[4326],{"type":230,"value":899},{"type":225,"tag":266,"props":4328,"children":4329},{"style":273},[4330],{"type":230,"value":904},{"type":225,"tag":266,"props":4332,"children":4333},{"style":279},[4334],{"type":230,"value":518},{"type":225,"tag":266,"props":4336,"children":4337},{"style":273},[4338],{"type":230,"value":913},{"type":225,"tag":266,"props":4340,"children":4341},{"style":279},[4342],{"type":230,"value":672},{"type":225,"tag":266,"props":4344,"children":4345},{"class":268,"line":712},[4346,4350,4354,4358,4362,4366,4370],{"type":225,"tag":266,"props":4347,"children":4348},{"style":678},[4349],{"type":230,"value":755},{"type":225,"tag":266,"props":4351,"children":4352},{"style":628},[4353],{"type":230,"value":930},{"type":225,"tag":266,"props":4355,"children":4356},{"style":279},[4357],{"type":230,"value":935},{"type":225,"tag":266,"props":4359,"children":4360},{"style":628},[4361],{"type":230,"value":894},{"type":225,"tag":266,"props":4363,"children":4364},{"style":279},[4365],{"type":230,"value":944},{"type":225,"tag":266,"props":4367,"children":4368},{"style":337},[4369],{"type":230,"value":949},{"type":225,"tag":266,"props":4371,"children":4372},{"style":279},[4373],{"type":230,"value":954},{"type":225,"tag":266,"props":4375,"children":4376},{"class":268,"line":741},[4377],{"type":225,"tag":266,"props":4378,"children":4379},{"style":279},[4380],{"type":230,"value":786},{"type":225,"tag":266,"props":4382,"children":4383},{"class":268,"line":749},[4384,4388,4392,4396,4400],{"type":225,"tag":266,"props":4385,"children":4386},{"style":432},[4387],{"type":230,"value":971},{"type":225,"tag":266,"props":4389,"children":4390},{"style":273},[4391],{"type":230,"value":772},{"type":225,"tag":266,"props":4393,"children":4394},{"style":279},[4395],{"type":230,"value":518},{"type":225,"tag":266,"props":4397,"children":4398},{"style":337},[4399],{"type":230,"value":984},{"type":225,"tag":266,"props":4401,"children":4402},{"style":279},[4403],{"type":230,"value":989},{"type":225,"tag":266,"props":4405,"children":4406},{"class":268,"line":780},[4407],{"type":225,"tag":266,"props":4408,"children":4409},{"style":279},[4410],{"type":230,"value":817},{"type":225,"tag":266,"props":4412,"children":4413},{"class":268,"line":789},[4414],{"type":225,"tag":266,"props":4415,"children":4416},{"style":279},[4417],{"type":230,"value":1006},{"type":225,"tag":226,"props":4419,"children":4420},{},[4421,4423,4428,4430,4436,4438,4445],{"type":230,"value":4422},"Having 2 different implementations of the ",{"type":225,"tag":262,"props":4424,"children":4426},{"className":4425},[],[4427],{"type":230,"value":559},{"type":230,"value":4429}," is great, but what if you need one of them in some part of your code? The one you will have injected in your class is the last one registered in the DI container, but that may not be the one you want. You could get all of them by injecting ",{"type":225,"tag":262,"props":4431,"children":4433},{"className":4432},[],[4434],{"type":230,"value":4435},"IEnumerable\u003CIWeatherService>",{"type":230,"value":4437}," and selecting the one you need. You could also create a sort of factory to retrieve the correct instance. Yet in .NET 8, you don't need to worry about all that because you have the ",{"type":225,"tag":244,"props":4439,"children":4442},{"href":4440,"rel":4441},"https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8#keyed-di-services",[248],[4443],{"type":230,"value":4444},"keyed DI Services",{"type":230,"value":518},{"type":225,"tag":226,"props":4447,"children":4448},{},[4449],{"type":230,"value":4450},"Specifying a key (that can be anything, not necessarily a string) is done when registering the services in the DI container.",{"type":225,"tag":255,"props":4452,"children":4454},{"className":612,"code":4453,"language":216,"meta":207,"style":207},"builder.Services.AddKeyedTransient\u003CIWeatherService, RandomWeatherService>(\"random\");\nbuilder.Services.AddKeyedTransient\u003CIWeatherService, OpenWeatherService>(\"api\");\n",[4455],{"type":225,"tag":262,"props":4456,"children":4457},{"__ignoreMap":207},[4458,4523],{"type":225,"tag":266,"props":4459,"children":4460},{"class":268,"line":269},[4461,4466,4470,4475,4479,4484,4488,4492,4496,4501,4506,4510,4515,4519],{"type":225,"tag":266,"props":4462,"children":4463},{"style":273},[4464],{"type":230,"value":4465},"builder",{"type":225,"tag":266,"props":4467,"children":4468},{"style":279},[4469],{"type":230,"value":518},{"type":225,"tag":266,"props":4471,"children":4472},{"style":273},[4473],{"type":230,"value":4474},"Services",{"type":225,"tag":266,"props":4476,"children":4477},{"style":279},[4478],{"type":230,"value":518},{"type":225,"tag":266,"props":4480,"children":4481},{"style":337},[4482],{"type":230,"value":4483},"AddKeyedTransient",{"type":225,"tag":266,"props":4485,"children":4486},{"style":279},[4487],{"type":230,"value":935},{"type":225,"tag":266,"props":4489,"children":4490},{"style":628},[4491],{"type":230,"value":559},{"type":225,"tag":266,"props":4493,"children":4494},{"style":279},[4495],{"type":230,"value":1329},{"type":225,"tag":266,"props":4497,"children":4498},{"style":628},[4499],{"type":230,"value":4500}," RandomWeatherService",{"type":225,"tag":266,"props":4502,"children":4503},{"style":279},[4504],{"type":230,"value":4505},">(",{"type":225,"tag":266,"props":4507,"children":4508},{"style":279},[4509],{"type":230,"value":658},{"type":225,"tag":266,"props":4511,"children":4512},{"style":412},[4513],{"type":230,"value":4514},"random",{"type":225,"tag":266,"props":4516,"children":4517},{"style":279},[4518],{"type":230,"value":658},{"type":225,"tag":266,"props":4520,"children":4521},{"style":279},[4522],{"type":230,"value":1380},{"type":225,"tag":266,"props":4524,"children":4525},{"class":268,"line":418},[4526,4530,4534,4538,4542,4546,4550,4554,4558,4562,4566,4570,4575,4579],{"type":225,"tag":266,"props":4527,"children":4528},{"style":273},[4529],{"type":230,"value":4465},{"type":225,"tag":266,"props":4531,"children":4532},{"style":279},[4533],{"type":230,"value":518},{"type":225,"tag":266,"props":4535,"children":4536},{"style":273},[4537],{"type":230,"value":4474},{"type":225,"tag":266,"props":4539,"children":4540},{"style":279},[4541],{"type":230,"value":518},{"type":225,"tag":266,"props":4543,"children":4544},{"style":337},[4545],{"type":230,"value":4483},{"type":225,"tag":266,"props":4547,"children":4548},{"style":279},[4549],{"type":230,"value":935},{"type":225,"tag":266,"props":4551,"children":4552},{"style":628},[4553],{"type":230,"value":559},{"type":225,"tag":266,"props":4555,"children":4556},{"style":279},[4557],{"type":230,"value":1329},{"type":225,"tag":266,"props":4559,"children":4560},{"style":628},[4561],{"type":230,"value":1257},{"type":225,"tag":266,"props":4563,"children":4564},{"style":279},[4565],{"type":230,"value":4505},{"type":225,"tag":266,"props":4567,"children":4568},{"style":279},[4569],{"type":230,"value":658},{"type":225,"tag":266,"props":4571,"children":4572},{"style":412},[4573],{"type":230,"value":4574},"api",{"type":225,"tag":266,"props":4576,"children":4577},{"style":279},[4578],{"type":230,"value":658},{"type":225,"tag":266,"props":4580,"children":4581},{"style":279},[4582],{"type":230,"value":1380},{"type":225,"tag":226,"props":4584,"children":4585},{},[4586],{"type":230,"value":4587},"With this key, retrieving a specific implementation becomes easy.",{"type":225,"tag":255,"props":4589,"children":4591},{"className":612,"code":4590,"language":216,"meta":207,"style":207},"    public WeatherForecastController([FromKeyedServices(\"random\")] IWeatherService weatherService, ILogger\u003CWeatherForecastController> logger)\n    {\n        _logger = logger;\n        _weatherService = weatherService;\n    }\n",[4592],{"type":225,"tag":262,"props":4593,"children":4594},{"__ignoreMap":207},[4595,4670,4677,4697,4716],{"type":225,"tag":266,"props":4596,"children":4597},{"class":268,"line":269},[4598,4602,4606,4611,4616,4620,4624,4628,4632,4637,4642,4646,4650,4654,4658,4662,4666],{"type":225,"tag":266,"props":4599,"children":4600},{"style":678},[4601],{"type":230,"value":755},{"type":225,"tag":266,"props":4603,"children":4604},{"style":337},[4605],{"type":230,"value":691},{"type":225,"tag":266,"props":4607,"children":4608},{"style":279},[4609],{"type":230,"value":4610},"([",{"type":225,"tag":266,"props":4612,"children":4613},{"style":337},[4614],{"type":230,"value":4615},"FromKeyedServices",{"type":225,"tag":266,"props":4617,"children":4618},{"style":279},[4619],{"type":230,"value":653},{"type":225,"tag":266,"props":4621,"children":4622},{"style":279},[4623],{"type":230,"value":658},{"type":225,"tag":266,"props":4625,"children":4626},{"style":412},[4627],{"type":230,"value":4514},{"type":225,"tag":266,"props":4629,"children":4630},{"style":279},[4631],{"type":230,"value":658},{"type":225,"tag":266,"props":4633,"children":4634},{"style":279},[4635],{"type":230,"value":4636},")]",{"type":225,"tag":266,"props":4638,"children":4639},{"style":273},[4640],{"type":230,"value":4641}," IWeatherService weatherService",{"type":225,"tag":266,"props":4643,"children":4644},{"style":279},[4645],{"type":230,"value":1329},{"type":225,"tag":266,"props":4647,"children":4648},{"style":273},[4649],{"type":230,"value":4228},{"type":225,"tag":266,"props":4651,"children":4652},{"style":279},[4653],{"type":230,"value":935},{"type":225,"tag":266,"props":4655,"children":4656},{"style":273},[4657],{"type":230,"value":607},{"type":225,"tag":266,"props":4659,"children":4660},{"style":279},[4661],{"type":230,"value":1104},{"type":225,"tag":266,"props":4663,"children":4664},{"style":273},[4665],{"type":230,"value":4245},{"type":225,"tag":266,"props":4667,"children":4668},{"style":279},[4669],{"type":230,"value":777},{"type":225,"tag":266,"props":4671,"children":4672},{"class":268,"line":418},[4673],{"type":225,"tag":266,"props":4674,"children":4675},{"style":279},[4676],{"type":230,"value":786},{"type":225,"tag":266,"props":4678,"children":4679},{"class":268,"line":428},[4680,4685,4689,4693],{"type":225,"tag":266,"props":4681,"children":4682},{"style":273},[4683],{"type":230,"value":4684},"        _logger ",{"type":225,"tag":266,"props":4686,"children":4687},{"style":279},[4688],{"type":230,"value":800},{"type":225,"tag":266,"props":4690,"children":4691},{"style":273},[4692],{"type":230,"value":4245},{"type":225,"tag":266,"props":4694,"children":4695},{"style":279},[4696],{"type":230,"value":738},{"type":225,"tag":266,"props":4698,"children":4699},{"class":268,"line":443},[4700,4704,4708,4712],{"type":225,"tag":266,"props":4701,"children":4702},{"style":273},[4703],{"type":230,"value":795},{"type":225,"tag":266,"props":4705,"children":4706},{"style":279},[4707],{"type":230,"value":800},{"type":225,"tag":266,"props":4709,"children":4710},{"style":273},[4711],{"type":230,"value":772},{"type":225,"tag":266,"props":4713,"children":4714},{"style":279},[4715],{"type":230,"value":738},{"type":225,"tag":266,"props":4717,"children":4718},{"class":268,"line":712},[4719],{"type":225,"tag":266,"props":4720,"children":4721},{"style":279},[4722],{"type":230,"value":817},{"type":225,"tag":226,"props":4724,"children":4725},{},[4726,4728,4735],{"type":230,"value":4727},"I did not discuss the code that requests the Open Weather Map API. It's quite simple thanks to the uses of ",{"type":225,"tag":244,"props":4729,"children":4732},{"href":4730,"rel":4731},"https://github.com/reactiveui/refit",[248],[4733],{"type":230,"value":4734},"Refit",{"type":230,"value":518},{"type":225,"tag":255,"props":4737,"children":4739},{"className":612,"code":4738,"language":216,"meta":207,"style":207},"using Refit;\n\nnamespace WeatherApi.Services.OpenWeatherMap;\n\npublic interface IOpenWeatherMapApi\n{\n    [Get(\"/forecast?lat={latitude}&lon={longitude}&units=metric\")]\n    Task\u003CWeatherMapResponse> GetWeatherForecast(double latitude, double longitude);\n}\n\npublic record WeatherMapResponse(IList\u003CWeatherMapForecast> List);\n\npublic record WeatherMapForecast(int Dt, WeatherMapMain Main);\n\npublic record WeatherMapMain(double Temp);\n",[4740],{"type":225,"tag":262,"props":4741,"children":4742},{"__ignoreMap":207},[4743,4759,4766,4798,4805,4822,4829,4862,4915,4922,4929,4977,4984,5028,5035],{"type":225,"tag":266,"props":4744,"children":4745},{"class":268,"line":269},[4746,4750,4755],{"type":225,"tag":266,"props":4747,"children":4748},{"style":290},[4749],{"type":230,"value":2425},{"type":225,"tag":266,"props":4751,"children":4752},{"style":273},[4753],{"type":230,"value":4754}," Refit",{"type":225,"tag":266,"props":4756,"children":4757},{"style":279},[4758],{"type":230,"value":738},{"type":225,"tag":266,"props":4760,"children":4761},{"class":268,"line":418},[4762],{"type":225,"tag":266,"props":4763,"children":4764},{"emptyLinePlaceholder":422},[4765],{"type":230,"value":425},{"type":225,"tag":266,"props":4767,"children":4768},{"class":268,"line":428},[4769,4773,4777,4781,4785,4789,4794],{"type":225,"tag":266,"props":4770,"children":4771},{"style":628},[4772],{"type":230,"value":3852},{"type":225,"tag":266,"props":4774,"children":4775},{"style":273},[4776],{"type":230,"value":3857},{"type":225,"tag":266,"props":4778,"children":4779},{"style":279},[4780],{"type":230,"value":518},{"type":225,"tag":266,"props":4782,"children":4783},{"style":273},[4784],{"type":230,"value":4474},{"type":225,"tag":266,"props":4786,"children":4787},{"style":279},[4788],{"type":230,"value":518},{"type":225,"tag":266,"props":4790,"children":4791},{"style":273},[4792],{"type":230,"value":4793},"OpenWeatherMap",{"type":225,"tag":266,"props":4795,"children":4796},{"style":279},[4797],{"type":230,"value":738},{"type":225,"tag":266,"props":4799,"children":4800},{"class":268,"line":443},[4801],{"type":225,"tag":266,"props":4802,"children":4803},{"emptyLinePlaceholder":422},[4804],{"type":230,"value":425},{"type":225,"tag":266,"props":4806,"children":4807},{"class":268,"line":712},[4808,4812,4817],{"type":225,"tag":266,"props":4809,"children":4810},{"style":678},[4811],{"type":230,"value":681},{"type":225,"tag":266,"props":4813,"children":4814},{"style":628},[4815],{"type":230,"value":4816}," interface",{"type":225,"tag":266,"props":4818,"children":4819},{"style":628},[4820],{"type":230,"value":4821}," IOpenWeatherMapApi\n",{"type":225,"tag":266,"props":4823,"children":4824},{"class":268,"line":741},[4825],{"type":225,"tag":266,"props":4826,"children":4827},{"style":279},[4828],{"type":230,"value":709},{"type":225,"tag":266,"props":4830,"children":4831},{"class":268,"line":749},[4832,4836,4841,4845,4849,4854,4858],{"type":225,"tag":266,"props":4833,"children":4834},{"style":279},[4835],{"type":230,"value":834},{"type":225,"tag":266,"props":4837,"children":4838},{"style":628},[4839],{"type":230,"value":4840},"Get",{"type":225,"tag":266,"props":4842,"children":4843},{"style":279},[4844],{"type":230,"value":653},{"type":225,"tag":266,"props":4846,"children":4847},{"style":279},[4848],{"type":230,"value":658},{"type":225,"tag":266,"props":4850,"children":4851},{"style":412},[4852],{"type":230,"value":4853},"/forecast?lat={latitude}&lon={longitude}&units=metric",{"type":225,"tag":266,"props":4855,"children":4856},{"style":279},[4857],{"type":230,"value":658},{"type":225,"tag":266,"props":4859,"children":4860},{"style":279},[4861],{"type":230,"value":672},{"type":225,"tag":266,"props":4863,"children":4864},{"class":268,"line":780},[4865,4870,4874,4879,4883,4888,4893,4898,4902,4906,4911],{"type":225,"tag":266,"props":4866,"children":4867},{"style":628},[4868],{"type":230,"value":4869},"    Task",{"type":225,"tag":266,"props":4871,"children":4872},{"style":279},[4873],{"type":230,"value":935},{"type":225,"tag":266,"props":4875,"children":4876},{"style":628},[4877],{"type":230,"value":4878},"WeatherMapResponse",{"type":225,"tag":266,"props":4880,"children":4881},{"style":279},[4882],{"type":230,"value":1104},{"type":225,"tag":266,"props":4884,"children":4885},{"style":337},[4886],{"type":230,"value":4887}," GetWeatherForecast",{"type":225,"tag":266,"props":4889,"children":4890},{"style":279},[4891],{"type":230,"value":4892},"(double",{"type":225,"tag":266,"props":4894,"children":4895},{"style":628},[4896],{"type":230,"value":4897}," latitude",{"type":225,"tag":266,"props":4899,"children":4900},{"style":279},[4901],{"type":230,"value":1329},{"type":225,"tag":266,"props":4903,"children":4904},{"style":279},[4905],{"type":230,"value":1334},{"type":225,"tag":266,"props":4907,"children":4908},{"style":628},[4909],{"type":230,"value":4910}," longitude",{"type":225,"tag":266,"props":4912,"children":4913},{"style":279},[4914],{"type":230,"value":1380},{"type":225,"tag":266,"props":4916,"children":4917},{"class":268,"line":789},[4918],{"type":225,"tag":266,"props":4919,"children":4920},{"style":279},[4921],{"type":230,"value":1006},{"type":225,"tag":266,"props":4923,"children":4924},{"class":268,"line":811},[4925],{"type":225,"tag":266,"props":4926,"children":4927},{"emptyLinePlaceholder":422},[4928],{"type":230,"value":425},{"type":225,"tag":266,"props":4930,"children":4931},{"class":268,"line":820},[4932,4936,4941,4946,4950,4955,4959,4964,4968,4973],{"type":225,"tag":266,"props":4933,"children":4934},{"style":678},[4935],{"type":230,"value":681},{"type":225,"tag":266,"props":4937,"children":4938},{"style":628},[4939],{"type":230,"value":4940}," record",{"type":225,"tag":266,"props":4942,"children":4943},{"style":628},[4944],{"type":230,"value":4945}," WeatherMapResponse",{"type":225,"tag":266,"props":4947,"children":4948},{"style":279},[4949],{"type":230,"value":653},{"type":225,"tag":266,"props":4951,"children":4952},{"style":628},[4953],{"type":230,"value":4954},"IList",{"type":225,"tag":266,"props":4956,"children":4957},{"style":279},[4958],{"type":230,"value":935},{"type":225,"tag":266,"props":4960,"children":4961},{"style":628},[4962],{"type":230,"value":4963},"WeatherMapForecast",{"type":225,"tag":266,"props":4965,"children":4966},{"style":279},[4967],{"type":230,"value":1104},{"type":225,"tag":266,"props":4969,"children":4970},{"style":628},[4971],{"type":230,"value":4972}," List",{"type":225,"tag":266,"props":4974,"children":4975},{"style":279},[4976],{"type":230,"value":1380},{"type":225,"tag":266,"props":4978,"children":4979},{"class":268,"line":828},[4980],{"type":225,"tag":266,"props":4981,"children":4982},{"emptyLinePlaceholder":422},[4983],{"type":230,"value":425},{"type":225,"tag":266,"props":4985,"children":4986},{"class":268,"line":874},[4987,4991,4995,5000,5005,5010,5014,5019,5024],{"type":225,"tag":266,"props":4988,"children":4989},{"style":678},[4990],{"type":230,"value":681},{"type":225,"tag":266,"props":4992,"children":4993},{"style":628},[4994],{"type":230,"value":4940},{"type":225,"tag":266,"props":4996,"children":4997},{"style":628},[4998],{"type":230,"value":4999}," WeatherMapForecast",{"type":225,"tag":266,"props":5001,"children":5002},{"style":279},[5003],{"type":230,"value":5004},"(int",{"type":225,"tag":266,"props":5006,"children":5007},{"style":628},[5008],{"type":230,"value":5009}," Dt",{"type":225,"tag":266,"props":5011,"children":5012},{"style":279},[5013],{"type":230,"value":1329},{"type":225,"tag":266,"props":5015,"children":5016},{"style":628},[5017],{"type":230,"value":5018}," WeatherMapMain",{"type":225,"tag":266,"props":5020,"children":5021},{"style":628},[5022],{"type":230,"value":5023}," Main",{"type":225,"tag":266,"props":5025,"children":5026},{"style":279},[5027],{"type":230,"value":1380},{"type":225,"tag":266,"props":5029,"children":5030},{"class":268,"line":920},[5031],{"type":225,"tag":266,"props":5032,"children":5033},{"emptyLinePlaceholder":422},[5034],{"type":230,"value":425},{"type":225,"tag":266,"props":5036,"children":5037},{"class":268,"line":957},[5038,5042,5046,5050,5054,5059],{"type":225,"tag":266,"props":5039,"children":5040},{"style":678},[5041],{"type":230,"value":681},{"type":225,"tag":266,"props":5043,"children":5044},{"style":628},[5045],{"type":230,"value":4940},{"type":225,"tag":266,"props":5047,"children":5048},{"style":628},[5049],{"type":230,"value":5018},{"type":225,"tag":266,"props":5051,"children":5052},{"style":279},[5053],{"type":230,"value":4892},{"type":225,"tag":266,"props":5055,"children":5056},{"style":628},[5057],{"type":230,"value":5058}," Temp",{"type":225,"tag":266,"props":5060,"children":5061},{"style":279},[5062],{"type":230,"value":1380},{"type":225,"tag":226,"props":5064,"children":5065},{},[5066,5068,5074],{"type":230,"value":5067},"I created an HTTP Message Handler to take care of adding the Open Weather Map API key to the requests. This API key and the URL to the API come from the configuration and are mapped to a configuration object ",{"type":225,"tag":262,"props":5069,"children":5071},{"className":5070},[],[5072],{"type":230,"value":5073},"WeatherMapConfiguration",{"type":230,"value":518},{"type":225,"tag":226,"props":5076,"children":5077},{},[5078,5080,5087,5089,5096],{"type":230,"value":5079},"In .NET 8, we can use ",{"type":225,"tag":244,"props":5081,"children":5084},{"href":5082,"rel":5083},"https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8#data-validation",[248],[5085],{"type":230,"value":5086},"data validation attributes",{"type":230,"value":5088}," for data like configuration options. There is also a ",{"type":225,"tag":244,"props":5090,"children":5093},{"href":5091,"rel":5092},"https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8#options-validation",[248],[5094],{"type":230,"value":5095},"source code generator",{"type":230,"value":5097}," that can implement the validation logic:",{"type":225,"tag":255,"props":5099,"children":5101},{"className":612,"code":5100,"language":216,"meta":207,"style":207},"namespace WeatherApi.Services.OpenWeatherMap;\n\npublic class WeatherMapConfiguration\n{\n    [Required]\n    public required string ApiKey { get; init; }\n\n    [Required]\n    [Url]\n    public required string Uri { get; init; }\n    \n}\n\n[OptionsValidator]\npublic partial class WeatherMapConfigurationValidator : IValidateOptions\u003CWeatherMapConfiguration>\n{\n}\n",[5102],{"type":225,"tag":262,"props":5103,"children":5104},{"__ignoreMap":207},[5105,5136,5143,5159,5166,5182,5229,5236,5251,5267,5311,5318,5325,5332,5348,5391,5398],{"type":225,"tag":266,"props":5106,"children":5107},{"class":268,"line":269},[5108,5112,5116,5120,5124,5128,5132],{"type":225,"tag":266,"props":5109,"children":5110},{"style":628},[5111],{"type":230,"value":3852},{"type":225,"tag":266,"props":5113,"children":5114},{"style":273},[5115],{"type":230,"value":3857},{"type":225,"tag":266,"props":5117,"children":5118},{"style":279},[5119],{"type":230,"value":518},{"type":225,"tag":266,"props":5121,"children":5122},{"style":273},[5123],{"type":230,"value":4474},{"type":225,"tag":266,"props":5125,"children":5126},{"style":279},[5127],{"type":230,"value":518},{"type":225,"tag":266,"props":5129,"children":5130},{"style":273},[5131],{"type":230,"value":4793},{"type":225,"tag":266,"props":5133,"children":5134},{"style":279},[5135],{"type":230,"value":738},{"type":225,"tag":266,"props":5137,"children":5138},{"class":268,"line":418},[5139],{"type":225,"tag":266,"props":5140,"children":5141},{"emptyLinePlaceholder":422},[5142],{"type":230,"value":425},{"type":225,"tag":266,"props":5144,"children":5145},{"class":268,"line":428},[5146,5150,5154],{"type":225,"tag":266,"props":5147,"children":5148},{"style":678},[5149],{"type":230,"value":681},{"type":225,"tag":266,"props":5151,"children":5152},{"style":628},[5153],{"type":230,"value":686},{"type":225,"tag":266,"props":5155,"children":5156},{"style":628},[5157],{"type":230,"value":5158}," WeatherMapConfiguration\n",{"type":225,"tag":266,"props":5160,"children":5161},{"class":268,"line":443},[5162],{"type":225,"tag":266,"props":5163,"children":5164},{"style":279},[5165],{"type":230,"value":709},{"type":225,"tag":266,"props":5167,"children":5168},{"class":268,"line":712},[5169,5173,5178],{"type":225,"tag":266,"props":5170,"children":5171},{"style":279},[5172],{"type":230,"value":834},{"type":225,"tag":266,"props":5174,"children":5175},{"style":628},[5176],{"type":230,"value":5177},"Required",{"type":225,"tag":266,"props":5179,"children":5180},{"style":279},[5181],{"type":230,"value":636},{"type":225,"tag":266,"props":5183,"children":5184},{"class":268,"line":741},[5185,5189,5194,5198,5203,5207,5211,5215,5220,5224],{"type":225,"tag":266,"props":5186,"children":5187},{"style":678},[5188],{"type":230,"value":755},{"type":225,"tag":266,"props":5190,"children":5191},{"style":678},[5192],{"type":230,"value":5193}," required",{"type":225,"tag":266,"props":5195,"children":5196},{"style":279},[5197],{"type":230,"value":2627},{"type":225,"tag":266,"props":5199,"children":5200},{"style":628},[5201],{"type":230,"value":5202}," ApiKey",{"type":225,"tag":266,"props":5204,"children":5205},{"style":279},[5206],{"type":230,"value":3174},{"type":225,"tag":266,"props":5208,"children":5209},{"style":628},[5210],{"type":230,"value":3966},{"type":225,"tag":266,"props":5212,"children":5213},{"style":279},[5214],{"type":230,"value":3971},{"type":225,"tag":266,"props":5216,"children":5217},{"style":628},[5218],{"type":230,"value":5219}," init",{"type":225,"tag":266,"props":5221,"children":5222},{"style":279},[5223],{"type":230,"value":3971},{"type":225,"tag":266,"props":5225,"children":5226},{"style":279},[5227],{"type":230,"value":5228}," }\n",{"type":225,"tag":266,"props":5230,"children":5231},{"class":268,"line":749},[5232],{"type":225,"tag":266,"props":5233,"children":5234},{"emptyLinePlaceholder":422},[5235],{"type":230,"value":425},{"type":225,"tag":266,"props":5237,"children":5238},{"class":268,"line":780},[5239,5243,5247],{"type":225,"tag":266,"props":5240,"children":5241},{"style":279},[5242],{"type":230,"value":834},{"type":225,"tag":266,"props":5244,"children":5245},{"style":628},[5246],{"type":230,"value":5177},{"type":225,"tag":266,"props":5248,"children":5249},{"style":279},[5250],{"type":230,"value":636},{"type":225,"tag":266,"props":5252,"children":5253},{"class":268,"line":789},[5254,5258,5263],{"type":225,"tag":266,"props":5255,"children":5256},{"style":279},[5257],{"type":230,"value":834},{"type":225,"tag":266,"props":5259,"children":5260},{"style":628},[5261],{"type":230,"value":5262},"Url",{"type":225,"tag":266,"props":5264,"children":5265},{"style":279},[5266],{"type":230,"value":636},{"type":225,"tag":266,"props":5268,"children":5269},{"class":268,"line":811},[5270,5274,5278,5282,5287,5291,5295,5299,5303,5307],{"type":225,"tag":266,"props":5271,"children":5272},{"style":678},[5273],{"type":230,"value":755},{"type":225,"tag":266,"props":5275,"children":5276},{"style":678},[5277],{"type":230,"value":5193},{"type":225,"tag":266,"props":5279,"children":5280},{"style":279},[5281],{"type":230,"value":2627},{"type":225,"tag":266,"props":5283,"children":5284},{"style":628},[5285],{"type":230,"value":5286}," Uri",{"type":225,"tag":266,"props":5288,"children":5289},{"style":279},[5290],{"type":230,"value":3174},{"type":225,"tag":266,"props":5292,"children":5293},{"style":628},[5294],{"type":230,"value":3966},{"type":225,"tag":266,"props":5296,"children":5297},{"style":279},[5298],{"type":230,"value":3971},{"type":225,"tag":266,"props":5300,"children":5301},{"style":628},[5302],{"type":230,"value":5219},{"type":225,"tag":266,"props":5304,"children":5305},{"style":279},[5306],{"type":230,"value":3971},{"type":225,"tag":266,"props":5308,"children":5309},{"style":279},[5310],{"type":230,"value":5228},{"type":225,"tag":266,"props":5312,"children":5313},{"class":268,"line":820},[5314],{"type":225,"tag":266,"props":5315,"children":5316},{"style":273},[5317],{"type":230,"value":3996},{"type":225,"tag":266,"props":5319,"children":5320},{"class":268,"line":828},[5321],{"type":225,"tag":266,"props":5322,"children":5323},{"style":279},[5324],{"type":230,"value":1006},{"type":225,"tag":266,"props":5326,"children":5327},{"class":268,"line":874},[5328],{"type":225,"tag":266,"props":5329,"children":5330},{"emptyLinePlaceholder":422},[5331],{"type":230,"value":425},{"type":225,"tag":266,"props":5333,"children":5334},{"class":268,"line":920},[5335,5339,5344],{"type":225,"tag":266,"props":5336,"children":5337},{"style":279},[5338],{"type":230,"value":625},{"type":225,"tag":266,"props":5340,"children":5341},{"style":628},[5342],{"type":230,"value":5343},"OptionsValidator",{"type":225,"tag":266,"props":5345,"children":5346},{"style":279},[5347],{"type":230,"value":636},{"type":225,"tag":266,"props":5349,"children":5350},{"class":268,"line":957},[5351,5355,5360,5364,5369,5373,5378,5382,5386],{"type":225,"tag":266,"props":5352,"children":5353},{"style":678},[5354],{"type":230,"value":681},{"type":225,"tag":266,"props":5356,"children":5357},{"style":678},[5358],{"type":230,"value":5359}," partial",{"type":225,"tag":266,"props":5361,"children":5362},{"style":628},[5363],{"type":230,"value":686},{"type":225,"tag":266,"props":5365,"children":5366},{"style":628},[5367],{"type":230,"value":5368}," WeatherMapConfigurationValidator",{"type":225,"tag":266,"props":5370,"children":5371},{"style":279},[5372],{"type":230,"value":696},{"type":225,"tag":266,"props":5374,"children":5375},{"style":628},[5376],{"type":230,"value":5377}," IValidateOptions",{"type":225,"tag":266,"props":5379,"children":5380},{"style":279},[5381],{"type":230,"value":935},{"type":225,"tag":266,"props":5383,"children":5384},{"style":628},[5385],{"type":230,"value":5073},{"type":225,"tag":266,"props":5387,"children":5388},{"style":279},[5389],{"type":230,"value":5390},">\n",{"type":225,"tag":266,"props":5392,"children":5393},{"class":268,"line":965},[5394],{"type":225,"tag":266,"props":5395,"children":5396},{"style":279},[5397],{"type":230,"value":709},{"type":225,"tag":266,"props":5399,"children":5400},{"class":268,"line":992},[5401],{"type":225,"tag":266,"props":5402,"children":5403},{"style":279},[5404],{"type":230,"value":1006},{"type":225,"tag":226,"props":5406,"children":5407},{},[5408,5410,5415,5417,5423],{"type":230,"value":5409},"This way we can make sure that the configuration contains the API Key and the URI that has the ",{"type":225,"tag":262,"props":5411,"children":5413},{"className":5412},[],[5414],{"type":230,"value":5262},{"type":230,"value":5416}," format. The configuration in the ",{"type":225,"tag":262,"props":5418,"children":5420},{"className":5419},[],[5421],{"type":230,"value":5422},"Program.cs",{"type":230,"value":5424}," looks like that:",{"type":225,"tag":255,"props":5426,"children":5428},{"className":612,"code":5427,"language":216,"meta":207,"style":207},"builder.Services.Configure\u003CWeatherMapConfiguration>(builder.Configuration.GetSection(\"WeatherMap\"));\nbuilder.Services.AddSingleton\u003CIValidateOptions\u003CWeatherMapConfiguration>, WeatherMapConfigurationValidator>();\n\nbuilder.Services.AddTransient\u003CApiKeyHandler>();\nbuilder.Services.AddRefitClient\u003CIOpenWeatherMapApi>()\n    .ConfigureHttpClient((provider, client) =>\n    {\n        var configuration = provider.GetRequiredService\u003CIOptions\u003CWeatherMapConfiguration>>().Value;\n        client.BaseAddress = new Uri(configuration.Uri);\n    })\n    .AddHttpMessageHandler\u003CApiKeyHandler>();\n",[5429],{"type":225,"tag":262,"props":5430,"children":5431},{"__ignoreMap":207},[5432,5512,5567,5574,5611,5648,5688,5695,5756,5807,5815],{"type":225,"tag":266,"props":5433,"children":5434},{"class":268,"line":269},[5435,5439,5443,5447,5451,5456,5460,5464,5468,5472,5476,5481,5485,5490,5494,5498,5503,5507],{"type":225,"tag":266,"props":5436,"children":5437},{"style":273},[5438],{"type":230,"value":4465},{"type":225,"tag":266,"props":5440,"children":5441},{"style":279},[5442],{"type":230,"value":518},{"type":225,"tag":266,"props":5444,"children":5445},{"style":273},[5446],{"type":230,"value":4474},{"type":225,"tag":266,"props":5448,"children":5449},{"style":279},[5450],{"type":230,"value":518},{"type":225,"tag":266,"props":5452,"children":5453},{"style":337},[5454],{"type":230,"value":5455},"Configure",{"type":225,"tag":266,"props":5457,"children":5458},{"style":279},[5459],{"type":230,"value":935},{"type":225,"tag":266,"props":5461,"children":5462},{"style":628},[5463],{"type":230,"value":5073},{"type":225,"tag":266,"props":5465,"children":5466},{"style":279},[5467],{"type":230,"value":4505},{"type":225,"tag":266,"props":5469,"children":5470},{"style":273},[5471],{"type":230,"value":4465},{"type":225,"tag":266,"props":5473,"children":5474},{"style":279},[5475],{"type":230,"value":518},{"type":225,"tag":266,"props":5477,"children":5478},{"style":273},[5479],{"type":230,"value":5480},"Configuration",{"type":225,"tag":266,"props":5482,"children":5483},{"style":279},[5484],{"type":230,"value":518},{"type":225,"tag":266,"props":5486,"children":5487},{"style":337},[5488],{"type":230,"value":5489},"GetSection",{"type":225,"tag":266,"props":5491,"children":5492},{"style":279},[5493],{"type":230,"value":653},{"type":225,"tag":266,"props":5495,"children":5496},{"style":279},[5497],{"type":230,"value":658},{"type":225,"tag":266,"props":5499,"children":5500},{"style":412},[5501],{"type":230,"value":5502},"WeatherMap",{"type":225,"tag":266,"props":5504,"children":5505},{"style":279},[5506],{"type":230,"value":658},{"type":225,"tag":266,"props":5508,"children":5509},{"style":279},[5510],{"type":230,"value":5511},"));\n",{"type":225,"tag":266,"props":5513,"children":5514},{"class":268,"line":418},[5515,5519,5523,5527,5531,5536,5540,5545,5549,5553,5558,5562],{"type":225,"tag":266,"props":5516,"children":5517},{"style":273},[5518],{"type":230,"value":4465},{"type":225,"tag":266,"props":5520,"children":5521},{"style":279},[5522],{"type":230,"value":518},{"type":225,"tag":266,"props":5524,"children":5525},{"style":273},[5526],{"type":230,"value":4474},{"type":225,"tag":266,"props":5528,"children":5529},{"style":279},[5530],{"type":230,"value":518},{"type":225,"tag":266,"props":5532,"children":5533},{"style":337},[5534],{"type":230,"value":5535},"AddSingleton",{"type":225,"tag":266,"props":5537,"children":5538},{"style":279},[5539],{"type":230,"value":935},{"type":225,"tag":266,"props":5541,"children":5542},{"style":628},[5543],{"type":230,"value":5544},"IValidateOptions",{"type":225,"tag":266,"props":5546,"children":5547},{"style":279},[5548],{"type":230,"value":935},{"type":225,"tag":266,"props":5550,"children":5551},{"style":628},[5552],{"type":230,"value":5073},{"type":225,"tag":266,"props":5554,"children":5555},{"style":279},[5556],{"type":230,"value":5557},">,",{"type":225,"tag":266,"props":5559,"children":5560},{"style":628},[5561],{"type":230,"value":5368},{"type":225,"tag":266,"props":5563,"children":5564},{"style":279},[5565],{"type":230,"value":5566},">();\n",{"type":225,"tag":266,"props":5568,"children":5569},{"class":268,"line":428},[5570],{"type":225,"tag":266,"props":5571,"children":5572},{"emptyLinePlaceholder":422},[5573],{"type":230,"value":425},{"type":225,"tag":266,"props":5575,"children":5576},{"class":268,"line":443},[5577,5581,5585,5589,5593,5598,5602,5607],{"type":225,"tag":266,"props":5578,"children":5579},{"style":273},[5580],{"type":230,"value":4465},{"type":225,"tag":266,"props":5582,"children":5583},{"style":279},[5584],{"type":230,"value":518},{"type":225,"tag":266,"props":5586,"children":5587},{"style":273},[5588],{"type":230,"value":4474},{"type":225,"tag":266,"props":5590,"children":5591},{"style":279},[5592],{"type":230,"value":518},{"type":225,"tag":266,"props":5594,"children":5595},{"style":337},[5596],{"type":230,"value":5597},"AddTransient",{"type":225,"tag":266,"props":5599,"children":5600},{"style":279},[5601],{"type":230,"value":935},{"type":225,"tag":266,"props":5603,"children":5604},{"style":628},[5605],{"type":230,"value":5606},"ApiKeyHandler",{"type":225,"tag":266,"props":5608,"children":5609},{"style":279},[5610],{"type":230,"value":5566},{"type":225,"tag":266,"props":5612,"children":5613},{"class":268,"line":712},[5614,5618,5622,5626,5630,5635,5639,5643],{"type":225,"tag":266,"props":5615,"children":5616},{"style":273},[5617],{"type":230,"value":4465},{"type":225,"tag":266,"props":5619,"children":5620},{"style":279},[5621],{"type":230,"value":518},{"type":225,"tag":266,"props":5623,"children":5624},{"style":273},[5625],{"type":230,"value":4474},{"type":225,"tag":266,"props":5627,"children":5628},{"style":279},[5629],{"type":230,"value":518},{"type":225,"tag":266,"props":5631,"children":5632},{"style":337},[5633],{"type":230,"value":5634},"AddRefitClient",{"type":225,"tag":266,"props":5636,"children":5637},{"style":279},[5638],{"type":230,"value":935},{"type":225,"tag":266,"props":5640,"children":5641},{"style":628},[5642],{"type":230,"value":1407},{"type":225,"tag":266,"props":5644,"children":5645},{"style":279},[5646],{"type":230,"value":5647},">()\n",{"type":225,"tag":266,"props":5649,"children":5650},{"class":268,"line":741},[5651,5656,5661,5666,5671,5675,5680,5684],{"type":225,"tag":266,"props":5652,"children":5653},{"style":279},[5654],{"type":230,"value":5655},"    .",{"type":225,"tag":266,"props":5657,"children":5658},{"style":337},[5659],{"type":230,"value":5660},"ConfigureHttpClient",{"type":225,"tag":266,"props":5662,"children":5663},{"style":279},[5664],{"type":230,"value":5665},"((",{"type":225,"tag":266,"props":5667,"children":5668},{"style":628},[5669],{"type":230,"value":5670},"provider",{"type":225,"tag":266,"props":5672,"children":5673},{"style":279},[5674],{"type":230,"value":1329},{"type":225,"tag":266,"props":5676,"children":5677},{"style":628},[5678],{"type":230,"value":5679}," client",{"type":225,"tag":266,"props":5681,"children":5682},{"style":279},[5683],{"type":230,"value":481},{"type":225,"tag":266,"props":5685,"children":5686},{"style":279},[5687],{"type":230,"value":1616},{"type":225,"tag":266,"props":5689,"children":5690},{"class":268,"line":749},[5691],{"type":225,"tag":266,"props":5692,"children":5693},{"style":279},[5694],{"type":230,"value":786},{"type":225,"tag":266,"props":5696,"children":5697},{"class":268,"line":780},[5698,5702,5707,5711,5716,5720,5725,5729,5734,5738,5742,5747,5752],{"type":225,"tag":266,"props":5699,"children":5700},{"style":628},[5701],{"type":230,"value":1509},{"type":225,"tag":266,"props":5703,"children":5704},{"style":628},[5705],{"type":230,"value":5706}," configuration",{"type":225,"tag":266,"props":5708,"children":5709},{"style":279},[5710],{"type":230,"value":853},{"type":225,"tag":266,"props":5712,"children":5713},{"style":273},[5714],{"type":230,"value":5715}," provider",{"type":225,"tag":266,"props":5717,"children":5718},{"style":279},[5719],{"type":230,"value":518},{"type":225,"tag":266,"props":5721,"children":5722},{"style":337},[5723],{"type":230,"value":5724},"GetRequiredService",{"type":225,"tag":266,"props":5726,"children":5727},{"style":279},[5728],{"type":230,"value":935},{"type":225,"tag":266,"props":5730,"children":5731},{"style":628},[5732],{"type":230,"value":5733},"IOptions",{"type":225,"tag":266,"props":5735,"children":5736},{"style":279},[5737],{"type":230,"value":935},{"type":225,"tag":266,"props":5739,"children":5740},{"style":628},[5741],{"type":230,"value":5073},{"type":225,"tag":266,"props":5743,"children":5744},{"style":279},[5745],{"type":230,"value":5746},">>().",{"type":225,"tag":266,"props":5748,"children":5749},{"style":273},[5750],{"type":230,"value":5751},"Value",{"type":225,"tag":266,"props":5753,"children":5754},{"style":279},[5755],{"type":230,"value":738},{"type":225,"tag":266,"props":5757,"children":5758},{"class":268,"line":789},[5759,5764,5768,5773,5777,5781,5785,5789,5794,5798,5803],{"type":225,"tag":266,"props":5760,"children":5761},{"style":273},[5762],{"type":230,"value":5763},"        client",{"type":225,"tag":266,"props":5765,"children":5766},{"style":279},[5767],{"type":230,"value":518},{"type":225,"tag":266,"props":5769,"children":5770},{"style":273},[5771],{"type":230,"value":5772},"BaseAddress ",{"type":225,"tag":266,"props":5774,"children":5775},{"style":279},[5776],{"type":230,"value":800},{"type":225,"tag":266,"props":5778,"children":5779},{"style":279},[5780],{"type":230,"value":3164},{"type":225,"tag":266,"props":5782,"children":5783},{"style":628},[5784],{"type":230,"value":5286},{"type":225,"tag":266,"props":5786,"children":5787},{"style":279},[5788],{"type":230,"value":653},{"type":225,"tag":266,"props":5790,"children":5791},{"style":273},[5792],{"type":230,"value":5793},"configuration",{"type":225,"tag":266,"props":5795,"children":5796},{"style":279},[5797],{"type":230,"value":518},{"type":225,"tag":266,"props":5799,"children":5800},{"style":273},[5801],{"type":230,"value":5802},"Uri",{"type":225,"tag":266,"props":5804,"children":5805},{"style":279},[5806],{"type":230,"value":1380},{"type":225,"tag":266,"props":5808,"children":5809},{"class":268,"line":811},[5810],{"type":225,"tag":266,"props":5811,"children":5812},{"style":279},[5813],{"type":230,"value":5814},"    })\n",{"type":225,"tag":266,"props":5816,"children":5817},{"class":268,"line":820},[5818,5822,5827,5831,5835],{"type":225,"tag":266,"props":5819,"children":5820},{"style":279},[5821],{"type":230,"value":5655},{"type":225,"tag":266,"props":5823,"children":5824},{"style":337},[5825],{"type":230,"value":5826},"AddHttpMessageHandler",{"type":225,"tag":266,"props":5828,"children":5829},{"style":279},[5830],{"type":230,"value":935},{"type":225,"tag":266,"props":5832,"children":5833},{"style":628},[5834],{"type":230,"value":5606},{"type":225,"tag":266,"props":5836,"children":5837},{"style":279},[5838],{"type":230,"value":5566},{"type":225,"tag":232,"props":5840,"children":5842},{"id":5841},"a-few-closing-words",[5843],{"type":230,"value":5844},"A few closing words",{"type":225,"tag":226,"props":5846,"children":5847},{},[5848],{"type":230,"value":5849},"Here is the recap of what we talked about:",{"type":230,"value":5851},"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",{"type":225,"tag":5853,"props":5854,"children":5855},"table",{},[5856,5875],{"type":225,"tag":5857,"props":5858,"children":5859},"thead",{},[5860],{"type":225,"tag":5861,"props":5862,"children":5863},"tr",{},[5864,5870],{"type":225,"tag":5865,"props":5866,"children":5867},"th",{},[5868],{"type":230,"value":5869},"Feature",{"type":225,"tag":5865,"props":5871,"children":5872},{},[5873],{"type":230,"value":5874},"Area",{"type":225,"tag":5876,"props":5877,"children":5878},"tbody",{},[5879,5897,5915,5931,5947,5964,5982,5998],{"type":225,"tag":5861,"props":5880,"children":5881},{},[5882,5892],{"type":225,"tag":5883,"props":5884,"children":5885},"td",{},[5886],{"type":225,"tag":244,"props":5887,"children":5889},{"href":1022,"rel":5888},[248],[5890],{"type":230,"value":5891},"Support for generic attributes",{"type":225,"tag":5883,"props":5893,"children":5894},{},[5895],{"type":230,"value":5896},".NET 8",{"type":225,"tag":5861,"props":5898,"children":5899},{},[5900,5910],{"type":225,"tag":5883,"props":5901,"children":5902},{},[5903],{"type":225,"tag":244,"props":5904,"children":5907},{"href":5905,"rel":5906},"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#primary-constructors",[248],[5908],{"type":230,"value":5909},"Primary constructors",{"type":225,"tag":5883,"props":5911,"children":5912},{},[5913],{"type":230,"value":5914},"C# 12",{"type":225,"tag":5861,"props":5916,"children":5917},{},[5918,5927],{"type":225,"tag":5883,"props":5919,"children":5920},{},[5921],{"type":225,"tag":244,"props":5922,"children":5924},{"href":3343,"rel":5923},[248],[5925],{"type":230,"value":5926},"Collection expressions",{"type":225,"tag":5883,"props":5928,"children":5929},{},[5930],{"type":230,"value":5914},{"type":225,"tag":5861,"props":5932,"children":5933},{},[5934,5943],{"type":225,"tag":5883,"props":5935,"children":5936},{},[5937],{"type":225,"tag":244,"props":5938,"children":5940},{"href":2581,"rel":5939},[248],[5941],{"type":230,"value":5942},"Optional parameters in lambda expressions",{"type":225,"tag":5883,"props":5944,"children":5945},{},[5946],{"type":230,"value":5914},{"type":225,"tag":5861,"props":5948,"children":5949},{},[5950,5960],{"type":225,"tag":5883,"props":5951,"children":5952},{},[5953],{"type":225,"tag":244,"props":5954,"children":5957},{"href":5955,"rel":5956},"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#alias-any-type",[248],[5958],{"type":230,"value":5959},"Alias any type",{"type":225,"tag":5883,"props":5961,"children":5962},{},[5963],{"type":230,"value":5914},{"type":225,"tag":5861,"props":5965,"children":5966},{},[5967,5977],{"type":225,"tag":5883,"props":5968,"children":5969},{},[5970],{"type":225,"tag":244,"props":5971,"children":5974},{"href":5972,"rel":5973},"https://learn.microsoft.com/en-us/visualstudio/debugger/using-the-debuggerdisplay-attribute",[248],[5975],{"type":230,"value":5976},"Debug customization attributes on ASP.NET Core types      ",{"type":225,"tag":5883,"props":5978,"children":5979},{},[5980],{"type":230,"value":5981},"ASP.NET Core 8",{"type":225,"tag":5861,"props":5983,"children":5984},{},[5985,5994],{"type":225,"tag":5883,"props":5986,"children":5987},{},[5988],{"type":225,"tag":244,"props":5989,"children":5991},{"href":5091,"rel":5990},[248],[5992],{"type":230,"value":5993},"Options validation",{"type":225,"tag":5883,"props":5995,"children":5996},{},[5997],{"type":230,"value":5896},{"type":225,"tag":5861,"props":5999,"children":6000},{},[6001,6010],{"type":225,"tag":5883,"props":6002,"children":6003},{},[6004],{"type":225,"tag":244,"props":6005,"children":6007},{"href":4440,"rel":6006},[248],[6008],{"type":230,"value":6009},"Keyed DI Services",{"type":225,"tag":5883,"props":6011,"children":6012},{},[6013],{"type":230,"value":5896},{"type":225,"tag":226,"props":6015,"children":6016},{},[6017,6019,6025,6027,6032,6034,6040],{"type":230,"value":6018},"There are many more interesting features in ",{"type":225,"tag":244,"props":6020,"children":6023},{"href":6021,"rel":6022},"https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12",[248],[6024],{"type":230,"value":5914},{"type":230,"value":6026},", ",{"type":225,"tag":244,"props":6028,"children":6030},{"href":4440,"rel":6029},[248],[6031],{"type":230,"value":5896},{"type":230,"value":6033},", or ",{"type":225,"tag":244,"props":6035,"children":6038},{"href":6036,"rel":6037},"https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-8.0?view=aspnetcore-8.0",[248],[6039],{"type":230,"value":5981},{"type":230,"value":6041},". Yet, the ones I introduced in this article are the ones I will probably use the most.",{"type":225,"tag":226,"props":6043,"children":6044},{},[6045,6047,6054,6056,6062],{"type":230,"value":6046},"You can find the complete code sample ",{"type":225,"tag":244,"props":6048,"children":6051},{"href":6049,"rel":6050},"https://github.com/TechWatching/CodeAppAndInfraInDotnet8",[248],[6052],{"type":230,"value":6053},"here",{"type":230,"value":6055},". The repository also contains a folder ",{"type":225,"tag":262,"props":6057,"children":6059},{"className":6058},[],[6060],{"type":230,"value":6061},"infra",{"type":230,"value":6063}," to set up the Azure infrastructure to host this API. 2 IaC solutions that use .NET are shown: one using Azure SDK and one using Pulumi.",{"type":225,"tag":226,"props":6065,"children":6066},{},[6067,6069,6076],{"type":230,"value":6068},"This article was published as part of the ",{"type":225,"tag":244,"props":6070,"children":6073},{"href":6071,"rel":6072},"https://www.csadvent.christmas/",[248],[6074],{"type":230,"value":6075},"C# Advent 2023",{"type":230,"value":6077}," which is a nice initiative. Make sure to check the other blog articles on the advent calendar.",{"type":225,"tag":6079,"props":6080,"children":6081},"style",{},[6082],{"type":230,"value":6083},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":207,"searchDepth":418,"depth":418,"links":6085},[6086,6087,6088],{"id":234,"depth":418,"text":237},{"id":530,"depth":418,"text":533},{"id":5841,"depth":418,"text":5844},"markdown","content:1.posts:56.playing-with-dotnet8.md","content","1.posts/56.playing-with-dotnet8.md","md",[6095,6109],{"_path":178,"_dir":205,"_draft":206,"_partial":206,"_locale":207,"title":177,"description":6096,"lead":6097,"date":6098,"image":6099,"badge":6101,"tags":6103,"ImageAttribution":6106,"_type":6089,"_id":6107,"_source":6091,"_file":6108,"_extension":6093},"Last year, I wrote my first annual retrospective. It was an interesting exercise that I intend to do every year. So for 2023, here is my year in review.","Challenges and achievements of 2023","2024-01-02T00:00:00.000Z",{"src":6100},"/images/review_1.jpg",{"label":6102},"Essay",[6104,6105],"thoughts","learning","Picture of \u003Ca href=\"https://unsplash.com/fr/@markuswinkler?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText\">Markus Winkler\u003C/a> on \u003Ca href=\"https://unsplash.com/fr/photos/-fRAIQHKcc0?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText\">Unsplash\u003C/a>","content:1.posts:57.2023-retro.md","1.posts/57.2023-retro.md",{"_path":172,"_dir":205,"_draft":206,"_partial":206,"_locale":207,"title":171,"description":6110,"lead":6111,"date":6112,"image":6113,"badge":6115,"tags":6117,"_type":6089,"_id":6125,"_source":6091,"_file":6126,"_extension":6093},"What if we could script the creation and configuration of a GitHub Repository so that it is ready to provision or deploy Azure resources from a GitHub Actions pipeline? We will do that in this article using the Azure CLI and GitHub CLI.","Scripting your Azure-Ready GitHub Repository using Azure and GitHub CLI","2023-10-23T00:00:00.000Z",{"src":6114},"/images/azureOIDC_2.webp",{"label":6116},"DevOps",[6118,6119,6120,6121,6122,6123,6124],"Azure","Azure CLI","GitHub","GitHub CLI","GitHub Actions","OpenID Connect","Microsoft Entra ID","content:1.posts:55.scripting-azure-ready-github-repository.md","1.posts/55.scripting-azure-ready-github-repository.md",1716749601489]