I wonder what is the best way to organize working with database from C# code.
I used to have different approaches for that:
- Each object has Save, Update and Delete methods, which implemented all the logic.
- There was some static class that has static methods Get, GetList, Update -- almost the same method as previous, but database logic was extracted from data domain class.
Now I think it will be great to have some non-static classes for each of datadomain class I need to store somewhere, that will do the storage.
What is the best way to do it? Are there any good libraries that provide good API for storing objects?