Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
Entity framework with business layer and data access layer
Mani Kandan
Jan 4 2017 7:10 AM
332
Reply
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<AccessHistory> 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<BAL.Model.AccessHistory> SelectAccessHistory(
int
idAccessHistory)
{
try
{
List < BAL.Model.AccessHistory > objBALAccessHistory = productCategoryDAL.SelectAccessHistory(idAccessHistory).ToList();
/*Here occuring error*/
return
objBALAccessHistory;
}
catch
(Exception ee)
{
throw
ee;
}
}
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
How to recover from the error?
call function from ascx.cs in javascript using ajax call