Clean data access across multiple projects in solution?
Hi all, I'm trying to architect a solution that uses best practices for data access. I have a solution with 3 projects currently..
- WebApi - asp.net core api entry
- EmailSenderFunction - serverless function that does some background email processing
- Domain - shared data access layer between the projects
What I'm struggling with is where to put my DTO's. Domain has my database entities, repository layer, and service layer currently which is shared between WebApi and EmailSenderFunc. Does it make sense to keep my controller models (ex. CreateContactRequest) inside the WebApi project and then when I need to perform curd operations with my service layer in domain, I map that model to an entity? Seems like a lot of extra work but I do want to maintain separation of concerns. Thanks