|
1 | | -# ME.Template |
2 | | -ME Template |
| 1 | +<h1>N-Tier Architecture Template</h1> |
| 2 | + |
| 3 | +<p>Bu proje, N-Tier Architecture ile çalışan projeler için gerekli olan 4 adet Item Template içeren bir Visual Studio Extension (VSIX) sağlamaktadır. Bu extension, projelerinizde kullanabileceğiniz <code>Entity</code>, <code>Dto</code>, <code>Repository</code>, ve <code>ServiceHelper</code> şablonlarını içerir.</p> |
| 4 | + |
| 5 | +<h2>İçindekiler</h2> |
| 6 | +<ul> |
| 7 | + <li><a href="#setup">Kurulum</a></li> |
| 8 | + <li><a href="#usage">Kullanım</a></li> |
| 9 | + <li><a href="#templates">Şablonlar</a> |
| 10 | + <ul> |
| 11 | + <li><a href="#entity">Entity</a></li> |
| 12 | + <li><a href="#dto">Dto</a></li> |
| 13 | + <li><a href="#repository">Repository</a></li> |
| 14 | + <li><a href="#servicehelper">ServiceHelper</a></li> |
| 15 | + </ul> |
| 16 | + </li> |
| 17 | +</ul> |
| 18 | + |
| 19 | +<h2 id="setup">Kurulum</h2> |
| 20 | +<ol> |
| 21 | + <li><strong>VSIX Dosyasını İndir</strong>: <a href="https://marketplace.visualstudio.com/items?itemName=BugraME.METemplate">VisualStudio Marketplace</a> sayfasından en son sürümü indirin.</li> |
| 22 | + <li><strong>Kurulum</strong>: İndirdiğiniz <code>.vsix</code> dosyasına çift tıklayın ve Visual Studio'ya yükleyin.</li> |
| 23 | + <li><strong>Visual Studio'yu Yeniden Başlatın</strong>: Değişikliklerin geçerli olması için Visual Studio'yu yeniden başlatın.</li> |
| 24 | +</ol> |
| 25 | + |
| 26 | +<h2 id="usage">Kullanım</h2> |
| 27 | +<ol> |
| 28 | + <li><strong>Yeni Item Ekleme</strong>: |
| 29 | + <ul> |
| 30 | + <li>Çözüm Gezgininden bir proje klasörüne sağ tıklayın.</li> |
| 31 | + <li><code>Add</code> > <code>New Item</code> seçeneğini seçin.</li> |
| 32 | + <li>Açılan pencerede <code>C# Items</code> > <code>ME Templates</code> içerisinden template seçin (<code>Entity</code>, <code>Dto</code>, <code>Repository</code>, <code>ServiceHelper</code>).</li> |
| 33 | + <li>Dosyanın ismini girin ve <code>Add</code> butonuna tıklayın.</li> |
| 34 | + </ul> |
| 35 | + </li> |
| 36 | +</ol> |
| 37 | +<img src="https://bugrame.com/images/me_template.gif" alt="ME Template" /> |
| 38 | + |
| 39 | +<h2 id="templates">Şablonlar</h2> |
| 40 | + |
| 41 | +<h3 id="entity">Entity</h3> |
| 42 | +<p><code>Entity</code> şablonu genellikle veritabanı tablolarını temsil eder ve veri modelini tanımlar.</p> |
| 43 | +<h4>Örnek Kullanım:</h4> |
| 44 | +<pre><code>public class Product : BaseDto { |
| 45 | +   |
| 46 | +}</code></pre> |
| 47 | + |
| 48 | +<h3 id="dto">Dto</h3> |
| 49 | +<p><code>Dto (Data Transfer Object)</code> şablonu genellikle veri aktarımı için kullanılan nesneleri oluşturmak için kullanılır.</p> |
| 50 | +<h4>Örnek Kullanım:</h4> |
| 51 | +<pre><code>public class ProductDto : BaseDto { |
| 52 | +   |
| 53 | +}</code></pre> |
| 54 | + |
| 55 | +<h3 id="repository">Repository</h3> |
| 56 | +<p><code>Repository</code> şablonu daha temiz bir mimari ve veri erişimini sağlar.</p> |
| 57 | +<h4>Örnek Kullanım:</h4> |
| 58 | +<pre><code>public class ProductRepository : BaseRepository<Product> { |
| 59 | + public ProductRepository() { } |
| 60 | +}</code></pre> |
| 61 | + |
| 62 | + |
| 63 | +<h3 id="servicehelper">ServiceHelper</h3> |
| 64 | +<p><code>ServiceHelper</code> şablonu, servis katmanında kullanılan yardımcı sınıfları oluşturmak için kullanılır. Servisler arasında kod tekrarını önler ve hata kontrolü yapar.</p> |
| 65 | +<h4>Örnek Kullanım:</h4> |
| 66 | +<pre><code>public class ProductService : BaseService<ProductRepository, ProductDto, Product> { |
| 67 | + public ProductService() { } |
| 68 | +} |
| 69 | +</code></pre> |
0 commit comments