title: Should I create in BLL project class the same like poco class in DAL project and return it to UI project if I want to display data from database?
body: <p>I have an architecture question. I have DAL project with poco classes (equivalent tables in database), BLL project and UI project. UI project has reference to BLL project and BLL project has reference to DAL project.</p>
  
  <p>I would like to display in UI project data for example from table Product from database. <strong>Should I create in BLL project class the same like poco class in DAL project and return it to UI project and display it?</strong></p>
  
  <p>So this is mine poco class in DAL (equivalent table in database):</p>
  
  <pre><code>public class Product 
  {
  
      public int  ID  {get; set; }
      public string  Name   {get; set; }
      public String  Address {get; set; }
  }
  </code></pre>
  
  <p>In BLL I have created business object the same like poco class above:</p>
  
  <pre><code>public class ProductBO
  {
      public int ID { get; set; }
      public string Name { get; set; }
      public String Address { get; set; }
  }
  </code></pre>
  
  <p>In BLL I have also method which gets products from DAL and map them to business objects - ProductBO:</p>
  
  <pre><code>public class ProductService
  {
      public List&lt;ProductBO&gt; GetAllProducts()
      {
          List&lt;ProductBO&gt; productsBO = new List&lt;ProductBO&gt;();
  
          using (var context = NorthwindFactory.CreateContext())
          {
              List&lt;Product&gt; products = context.Product.ToList();
  
              foreach (var product in products)
              {
                  productsBO.Add(new ProductBO { ID = product.ID, Address = product.Address, Name = product.Name });
              }
          }
  
          return productsBO;
      }
  }
  </code></pre>
  
  <p>And now in UI project in controller I call service from BLL which returns List and in view I can display data using business object ProductBO.</p>
  
  <pre><code>@model IEnumerable&lt;WebApplication1.BLL.BusinessObjects.ProductBO&gt;
  
  &lt;table class="table"&gt;
      &lt;tr&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.Name)
          &lt;/th&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.Address)
          &lt;/th&gt;
      &lt;/tr&gt;
  @foreach (var item in Model) {
      &lt;tr&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Name)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Address)
          &lt;/td&gt;
      &lt;/tr&gt;
  }
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>Is it correct architecture approach?</strong></p>