Syntax
new object{ id = album.AlbumId }
should give a compiler error, because "id" is not a property of the object.
Syntax
new { id = album.AlbumId }
is correct. It creates an anonymous type with id property
Note that in the view you will not get a compiler error at compile time (this may seem intuitive). The view is compiled at runtime. You may see a red error when there is an error in the view source code indicating a problem, but I found that it only works sometimes.
I saw the same problem as Visual Studio, introducing the wrong object after a new one.
source share