Var Keyword: All the methods, property or any other information are available at compile time.
Dynamic Keyword: As the name suggest all the method, property and other information is available at run time.
Let's understand it with a example.
class Employee
{
public int Id { get; set; }
public string Name { get; set; }
public int Salary { get; set; }
}
var employee=new Employee(){ Id=1, Name="Diwakar", Salary=6000 } ;
Console.WriteLine("Employee First Name:"+employee.Name);
Console.WriteLine("Employee Last Name:"+employee.Last); // This line will give compile time error, As Employee class does not have Last Property.
dynamic employee = new Employee() { Id = 1, Name = "Diwakar", Salary = 6000 };
Console.WriteLine("Employee Name:"+employee.Name);
Console.WriteLine("Employee Last Name:"+employee.Last);//This line will compile successfully but it will throw exception at runtime.