What is the purpose of @ (arroba) both in controller how much in the view?
In the View, indicates to the Razor engine that the following code is to be interpreted by .NET. Can be used on a line:
@if (condicao) { ... }
Or it can serve as a block opening:
@{
var minhaVariavel = ...;
}
In theory, the Razor engine interprets any . NET code, but the most commonly used ones are C# and VB.NET.
I do not recommend much use the second because business logic in View should be discouraged, since the View is for presentation, not for logic. It is important to know that the resource exists, but should not be used as in PHP.
What are these calls for { get; set; }
that the staff put on model?
Are automatic properties (auto properties). It is a concise way of writing the following:
private int _id;
public int id {
get { return _id; }
set { _id = value; }
}
As the definition of properties is often used, this more streamlined writing saves programmer effort.