C#C
C#6mo ago
Nikolas

✅ Is there any benefit to separating your service models and repository entities?

I'm writing a C# ASP.NET application using the Repository pattern, and I recently asked in #help-0 about whether I needed separate models for the controller, service, and repository layer, and someone mentioned to me that I probably didn't need to separate the service model and the repository entity since I didn't have any purpose. I tried to think of why it I should, but I couldn't think of anything other than "It's best practice", especially considering my repository entities don't contain anything specific to the database. Is there any particular reason on why I should separate them that I'm missing?

Thank you!
Was this page helpful?