To anyone who comes here to see why the Id
field of your model is defaulted to 0
during instantiated (through new Foo()
for example), see here for reference. It is the C#'s design to default integral data type like int
to 0
when it is not assigned a value.