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
ejaz mirza
NA
471
47.5k
Transaction based approch in asp.net mvc5
Aug 5 2019 6:05 AM
My application is in N tier architechture i just want to make it as transaction based
should i add transaction globally
public
ActionResult adddepartment(LbMsDepartment dt)
{
dt.CreatedBy = 1;
dt.CreatedOn = DateTime.Now;
dt.OS =
""
+1;
dt.Browser =
""
+1;
dt.DeptStat =
true
;
dt.IP =
""
+1;
testingtranscationAdd(dt);
testingtranscationupdate(dt);
return
View();
}
//in BLL Layer the two mthods splits like that in DLL also
public
void
testingtranscationAdd(LbMsDepartment dt)
{
dt.DeptName =
"tested"
;
dt.DeptDesc =
"transaction testing"
;
hms.LbMsDepartments.Add(dt);
int
i = hms.SaveChanges();
}
public
void
testingtranscationupdate(LbMsDepartment dt)
{
dt.DeptName =
"tested"
;
dt.DeptDesc =
"transaction testing"
;
hms.LbMsDepartments.Add(dt);
int
i = hms.SaveChanges();
}
In the above code i want apply transaction based approch .
Reply
Answers (
3
)
Total count month using c#
How do you update an edmx file with database changes?