.Net Core Businnes Layer Best practice

Viewed 42

I have a lot of Entities User, Socialmedia, Image, Video, DriverLicense Etc... I want to know best practice, I have business layer, Checking all my user related tables in one service? Or write separate services for each. Example;

ISocailMediaService IImageService IVideoService Etc..

I want to know best practice... Because I have 43 entities. how to do thanks...

1 Answers

It's good practice to separate them following entities. But you have alot of entities, then it's best practice to follow your controller. For example, you have SocialController, then use ISocialService. You can use many necessary repositories like SocialMediaRepository + ImageRepository + VideoRepository in ISocialService.cs/SocialService.cs.

Related