using System.Collections.Generic;
public static void Main()
Dictionary<string, int> dictionary = new Dictionary<string, int>();
dictionary.Add("key", 10);
if (dictionary.ContainsKey("key")){
dictionary["key"] = dictionary["key"] + newValue;
foreach (var key in dictionary){
Console.WriteLine(key.Value);
var MethodSyntax = Student.GetStudents().SelectMany(std => std.Programming, (student, program) => new
StudentName = student.Name, ProgramName = program
from std in Student.GetStudents()from program in std.Programming
StudentName = std.Name, ProgramName = program
foreach (var item in QuerySyntax)
Console.WriteLine(item.StudentName + " => " + item.ProgramName);
public int ID { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public List<string> Programming { get; set; }
public static List<Student> GetStudents()
return new List<Student>()
{ID = 1, Name = "James", Email = "James@j.com", Programming = new List<string>()
{"C#", "Jave", "C++"}}, new Student()
{ID = 2, Name = "Sam", Email = "Sara@j.com", Programming = new List<string>()
{"WCF", "SQL Server", "C#"}}, new Student()
{ID = 3, Name = "Patrik", Email = "Patrik@j.com", Programming = new List<string>()
{"MVC", "Jave", "LINQ"}}, new Student()
{ID = 4, Name = "Sara", Email = "Sara@j.com", Programming = new List<string>()
{"ADO.NET", "C#", "LINQ"}}};