Answers
- No, you can have as many layers as you need and name and organize them as you want.
- No, both have their place, their pros, and their cons.
- Yes. A
DbContext
is an implementation of the Unit of Work pattern.DbSet<T>
is an implementation of the Repository pattern. - No, you can query any system in any way you want. For example, you could use ADO.NET to query a relational database manually and create the objects using data from a
DataReader
, track changes using aDataSet
, or do anything else that fits your needs. Nonetheless, ORMs can be very convenient. - Yes. A layer can never access outward layers, only inward ones.
Learn more on Discord
To join the Discord community for this book – where you can share feedback, ask questions to the author, and learn about new releases – follow the QR code below: