17
1
Option Strict On
2
Imports System
3
Imports System.Linq
4
Public Module Module1
5
Public Sub Main()
6
'Declare a collection to store names
7
Dim names() As String = {"David", "Michael", "Stephen"}
8
9
'Print the first value from the collection
10
Console.WriteLine(names.First()) 'names.First() = "David"
11
12
'Print the first or default value from the collection that matches what the user input
13
Console.Write("Name: ")
14
Dim input As String = Console.ReadLine()
15
Console.WriteLine((From name As String In names Where name = name).FirstOrDefault())
16
End Sub
17
End Module
Cached Result
Contact1 (JsonPropertyName): OK, type = Phone
Contact1 (JsonPropertyName): FAIL, message = The JSON value could not be converted to System.Nullable`1[Program+ContactType1]. Path: $.type | LineNumber: 0 | BytePositionInLine: 17.
Contact2 (EnumMember): OK, type = Phone
Contact2 (EnumMember): FAIL, message = The JSON value could not be converted to System.Nullable`1[Program+ContactType2]. Path: $.type | LineNumber: 0 | BytePositionInLine: 17.
Contact3 (JsonStringEnumConverter): OK, type = Phone
Contact3 (JsonStringEnumConverter): OK, type = Phone
Contact1 (JsonPropertyName): FAIL, message = The JSON value could not be converted to System.Nullable`1[Program+ContactType1]. Path: $.type | LineNumber: 0 | BytePositionInLine: 17.
Contact2 (EnumMember): OK, type = Phone
Contact2 (EnumMember): FAIL, message = The JSON value could not be converted to System.Nullable`1[Program+ContactType2]. Path: $.type | LineNumber: 0 | BytePositionInLine: 17.
Contact3 (JsonStringEnumConverter): OK, type = Phone
Contact3 (JsonStringEnumConverter): OK, type = Phone