Question: What's the difference between a repository and a service? I don't seem to grasp it.

I'm talking about data access through a data access layer, typically with linq to sql.

Very often i see repositories with simple CRUD methods, and services with more business-specific methods.

We can take [this](https://web.archive.org/web/20160702012441/https://weblogs.asp.net/rashid/shrinkr-url-shrinking-service-developed-with-entity-framework-4-0-unity-asp-net-mvc-and-jquery-part-1) blog post as an example. If you look at the interfaces at the bottom (images), he has two repositories and two services. How does one know what to put where?

As I said, repositories seems to be more for CRUD-like operations and Services more business oriented.

Answer: 
The repository is where the data is stored. The service is what manipulates the data.

In a real-world situation comparison, if your money is stored in a vault in a bank, the vault is the repository. The teller that deposits, withdraws, etc is the service.
Take for instance in a MVC application.The Controller gives instruction to the Service and the service talks to the Repository to do some CRUD to the data in database.

This is done using DI(Dependency Injection:this is like a child telling the father to give him money but is not bothered about how the money is gotten,so the methods of getting the money was abstracted from the child's knowledge)

Repository communicate with the database either using raw SQL query Or Via ORM(e.g Eloquent,Sequelize,Gorm,Hibernate e.t.c)

Service calls one or more methods in the repository to get a specific result.(in the service you can call a sample method in the repository called findOne() and then base on the result you can call updateOne())