My application is in N tier architechture i just want to make it as transaction based
should i add transaction globallyIn the above code i want apply transaction based approch .
- 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();
- }
ejaz mirzaPosted Aug 6, 2019, 12:20 AM
Amit MohantyPosted Aug 5, 2019, 11:29 PM
Chittaranjan SwainPosted Aug 5, 2019, 11:16 PM