Anonymous type can be used only in the scope where it was declared. So you can use it to local tasks and can't use it in the outer scope.
The anonymous types was introduced to use with linq to achive an easy grouping and transformations.
The main goal is avoid an explicit type declaration which will used in the single scope.
List<TypeOne> firstList;
List<TypeTwo> secondList;
var joined = firstList
.GroupJoin(secondlist, i => i.KeyOfTypeOne, i => i.KeyOfTypeTwo, (first, second) => new { First = first, Second = second});
So a new anonymous type is declared and you can use it in the same context but can't send to the boundaries of the current scope as a strongly typed object
TypeName Method() // you can't specify a type here except object or dynamic
{
...
return joined;
}
but you can use it locally without any restrictions
return joined.Where(i => i.Second.Any()).Select(i => i.First);
And the implicitly typed variables on the other hand is used to allow you to use object of an anonymous type. Compilator will investigate your code and put real type instead of the var keyword.
var inst = new {Name = "a";}
compilator will generate an anonymous type "{Name = "a";}" and use it to replace var in your code.