I am working on a Restful WCF API. I figured out it would be nice to have one service contract for API related to Users (IUserService
) and then for example another one for Posts that users add to the database (IPostService
). This approach makes it easier to read the code , as well as to collaborate on the code, since several people can work on separate files.
However, this way, to make a requests I would have to call <url>/UserService.svc/user/123
to get a user and <url>/PostService.svc/post/456
to get a post.
Is this a viable solution , or should I have just one service for a case like this ? If yes, is there a way how to make it easier to collaborate and read the code ? Maybe with partial classes?
I don't have much experience with theses technologies and C# in general, so I will appreciate any help :)
Thanks.