File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
docs/standard/serialization/system-text-json/snippets/how-to/vb Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change 11Imports System.Text.Json
22
3- Namespace SystemTextJsonSamples
3+ Namespace DeserializeExtra
44
5- Public NotInheritable Class DeserializeExtra
5+ Public Class WeatherForecast
6+ Public Property [Date] As DateTimeOffset
7+ Public Property TemperatureCelsius As Integer
8+ Public Property Summary As String
9+ Public SummaryField As String
10+ Public Property DatesAvailable As IList( Of DateTimeOffset)
11+ Public Property TemperatureRanges As Dictionary( Of String , HighLowTemps)
12+ Public Property SummaryWords As String ()
13+ End Class
14+
15+ Public Class HighLowTemps
16+ Public Property High As Integer
17+ Public Property Low As Integer
18+ End Class
19+
20+ Public NotInheritable Class Program
621
722 Public Shared Sub Run()
823 Dim jsonString As String =
@@ -31,8 +46,8 @@ Namespace SystemTextJsonSamples
3146 ]
3247 } "
3348
34- Dim weatherForecast As WeatherForecastWithPOCOs =
35- JsonSerializer.Deserialize( Of WeatherForecastWithPOCOs )(jsonString)
49+ Dim weatherForecast As WeatherForecast =
50+ JsonSerializer.Deserialize( Of WeatherForecast )(jsonString)
3651
3752 Console.WriteLine( $"Date: {weatherForecast?.Date}" )
3853 Console.WriteLine( $"TemperatureCelsius: {weatherForecast?.TemperatureCelsius}" )
You can’t perform that action at this time.
0 commit comments