Last active
September 28, 2022 09:57
-
-
Save losch/d2a39ff3f88ee19b07e8d7f54979b354 to your computer and use it in GitHub Desktop.
C-risuaitaus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
class Breakfast { | |
private Dictionary<string, string> _dict; | |
public string Ham => _dict["ham"]; | |
public string Bacon => _dict["bacon"]; | |
public string Broccoli => _dict["broccoli"]; | |
public Breakfast(Dictionary<string, string> dict) { | |
_dict = dict; | |
} | |
} | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var breakfastDict = new Dictionary<string, string> { | |
{"ham", "No"}, | |
{"bacon", "No"}, | |
{"broccoli", "Yes"} | |
}; | |
var breakfast = new Breakfast(breakfastDict); | |
Console.WriteLine($"breakfast: {breakfast.Ham}"); // "No" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment