This has nothing to do with EF. This is a C # language feature. When you declare class properties with { ... } , you do not need to indicate that an empty class constructor should be called. Example:
new StatusTypeModel() { StatusTypeId = s.StatusTypeId, ... }
exactly the same:
new StatusTypeModel { StatusTypeId = s.StatusTypeId, ... }
There is no difference in performance. The generated IL (intermediate language) is identical.
However, if you do not declare properties, you must call the constructor as follows:
var x = new StatusTypeModel();
source share