TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
533
2.4k
598.2k
Entity framework with business layer and data access layer
Jan 4 2017 7:10 AM
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;
}
}
}
}
Reply
Answers (
4
)
How to recover from the error?
call function from ascx.cs in javascript using ajax call