Why do we need the backing fields in EF Core?
Why would someone want to use a field instead of a property while working with the entities? I can not come up with such a case. That probably means that I do not understand or I am missing something about the fields, since I thought that I could accomplish anything what is possible to do with the fields with the properties as well.
I am learning the EF Core through the tutorials over here.
Properties do not store anything. They are a pair of set and get methods. You must have a backing field to have them store something.
But you can simplify this code by using automatic properties
This 2nd code snippet does exactly the same as the first one.
EF Core prefers backing fields over properties if their name can be inferred from the property name. The Conventions say: