Populating the storage space list

The next stage is to populate our list of storage spaces:

private void PopulateStorageSpacesList(){    List<KeyValuePair<int, string>> lstSpaces =        new List<KeyValuePair<int, string>>();    BindStorageSpaceList((int)_storageSpaceSelection.NoSelection, "Select Storage Space");    void BindStorageSpaceList(int key, string value) =>             lstSpaces.Add(new KeyValuePair<int, string>(key, value));        if (_spaces is null || _spaces.Count() == 0) // Pattern matching    {        BindStorageSpaceList((int)_storageSpaceSelection.New, " <create new> ");    }    else    {        foreach (var space in _spaces)        {            BindStorageSpaceList(space.ID, space.Name);        }    }    dlVirtualStorageSpaces.DataSource = new        BindingSource(lstSpaces, null); dlVirtualStorageSpaces.DisplayMember ...

Get C# 8 and .NET Core 3 Projects Using Azure - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.