title: Naming conventions for methods in Repository pattern?
body: <p>I'm trying to learn better software design and recently found the Repository and Service Layer patterns. From my understanding, the repository basically contains the data access code and the service layer calls the repository to get that data and then performs some logic and processing to that data.</p>
  
  <p>So far from reading up on these there is, generally, not a set series of methods that the repository has. However, the repository usually has methods along these lines:</p>
  
  <ul>
  <li>List/Get/Read/etc.</li>
  <li>Create</li>
  <li>Save</li>
  <li>Update</li>
  <li>Delete</li>
  </ul>
  
  <p>I'm trying to understand the naming conventions for repositories. What should I call the "List/Get/Read/etc." method? I'll give an example.</p>
  
  <p>I'm currently working on a project that will read from a bunch of directories and files. These files represent sensor readings that are being generated by a completely separate and already existing system.</p>
  
  <p>Should method names be specific to that particular type of repository or go for more generic sounding names? Such as:</p>
  
  <p>Generic names:</p>
  
  <pre><code>interface ISensorRepository
  {
      IEnumerable&lt;Sensor&gt; GetAll(); /  IEnumerable&lt;Sensor&gt; ListAll(); / etc.
      Sensor GetByID(int id);
  }
  </code></pre>
  
  <p>Entity specific names:</p>
  
  <pre><code>interface ISensorRepository
  {
      IEnumerable&lt;Sensor&gt; GetAllSensors(); / IEnumerable&lt;Sensor&gt; ListAllSensors(); / etc.
      Sensor GetSensorByID(int id);
  }
  </code></pre>