Hello Everyone,
I have model.edmx file, DataAccessLayer, BussinessLayer and MVC. I have done DAL layer .dll referred inside BAL layer. How can I connect with each other without using AUTOMAPPER ?
DAL,
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using DAL.Model;
- namespace DAL
- {
- public class ProductCategoryDAL
- {
- public List
SelectAccessHistory( int idAccessHistory) - {
- using (var context = new REBOXEntities())
- {
- if (idAccessHistory > 0)
- return context.AccessHistories.Where(s => s.idAccessHistory == idAccessHistory).ToList();
- else
- return context.AccessHistories.ToList();
- }
- }
- }
- }
BAL,
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using DAL;
- using DAL.Model;
- namespace BAL
- {
- public class ProductCategoryBAL
- {
- ProductCategoryDAL productCategoryDAL = new ProductCategoryDAL();
- public List
SelectAccessHistory( int idAccessHistory) - {
- try
- {
- List < BAL.Model.AccessHistory > objBALAccessHistory = productCategoryDAL.SelectAccessHistory(idAccessHistory).ToList(); /*Here occuring error*/
- return objBALAccessHistory;
- }
- catch (Exception ee)
- {
- throw ee;
- }
- }
- }
- }

Chetan RanpariyaPosted Jan 4, 2017, 9:52 AM
Abhilash J APosted Jan 4, 2017, 10:38 AM
Tapan PatelPosted Jan 4, 2017, 8:48 AM
If you are going away from the automapper then you may want to write your own method (kind of conversion methods) in BAL that converts your entity objects to business & vice-a-versa.
Chetan RanpariyaPosted Jan 4, 2017, 8:12 AM