title: Repository or Service to insert data in database - Entity Framework
body: <p>What do I use to create a new Address using Entity Framework:</p>
  
  <p>Op1:</p>
  
  <pre><code>IRepository&lt;Address&gt; _addressRepository;
  </code></pre>
  
  <p>And talk directly to the Database using the the Address Entity.</p>
  
  <p>Op2:</p>
  
  <pre><code>public bool CreateAddress(AddressDto addressDto);
  </code></pre>
  
  <p>And talk to the service method to insert a new Address.</p>
  
  <p>The question is, in a long turn maintenance of the project, which one gives more guarantees of not existing the risk of someone change something and break another piece of code that depends on it?</p>
  
  <p>Based on your experience, which one is the best approach?</p>