Wow mind blown... But I did follow some of Marco's previous tutorials/snippets that lead me to some of these bad practices actually. Always glad to learn why I'm doing things wrong though.
Even if you have validated your entity in memory, even if the entity is following every advice that he said we can't be sure that our Entity is 100% valid until we talk to our database. Supose an entity A instance has a reference to an entity B instance, while we are using it in memory, another request can just delete entity B instance on the database and then when we try to save A we got an exception. Nice talk btw.
Wow mind blown... But I did follow some of Marco's previous tutorials/snippets that lead me to some of these bad practices actually. Always glad to learn why I'm doing things wrong though.
Cool, I have saw this slides already, but with comments they are even better.
Even if you have validated your entity in memory, even if the entity is following every advice that he said we can't be sure that our Entity is 100% valid until we talk to our database. Supose an entity A instance has a reference to an entity B instance, while we are using it in memory, another request can just delete entity B instance on the database and then when we try to save A we got an exception. Nice talk btw.