Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:36:51+00:00 2026-06-03T14:36:51+00:00

Pls see this first: Good Coding Practices So, this is my design. Website 2.Business

  • 0

Pls see this first:
Good Coding Practices

So, this is my design.

  1. Website
    2.Business Logic Layer
    3.DALFacade (we use dalfacade to hide the data access, because we use 2 different stores, sql and db2)
    4.DAL

In the DAL we use unit of work pattern and repository pattern.
1. The big question here is: If the code below will run ok for transactions that are created from the business logic.?

Page:

public partial class NewBonusRequest : System.Web.UI.Page
{

    #region Constructor and Instantiation of Business Logic
        /// <summary>
        /// Property that holds the Business Logic type to call methods
        /// </summary>
        public IRequestBL RequestBL { get; private set; }

        /// <summary>
        /// The default constructor will use the default implementation of the business logic interface
        /// </summary>
        public Request()
            : this(new RequestBL())
        {
        }

        /// <summary>
        /// The constructor accepts a IEcoBonusRequestFacade type
        /// </summary>
        /// <param name="ecoBonusRequestBL">IEcoBonusRequestFacade type</param>
        public NewRequest(IRequestBL RequestBL)
        {
            RequestBL = RequestBL;
        } 
    #endregion


    protected void PageLoad(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {

        }
    }


    #region Control Events
        protected void BtnSubmitRequestClick(object sender, EventArgs e)
        {
            var request= new Request
                                       {
                                           IsOnHold = true
                                           //All other properties go here.
                                       };

            RequestBL.Save(request);
        }



    Business Logic Code.

    public interface IRequestBL
    {
        void Save(Request request);
    }

    /// <summary>
    /// Class in charge of the business logic for EcoBonusRequest
    /// </summary>
    public class RequestBL : IRequestBL
    {
        /// <summary>


        /// <summary>
        /// Saves a new ecobonus request into database and evaluate business rules here
        /// </summary>
        /// <param name="ecoBonusWorkflow">EcoBonusWorkflow entity</param>
        public void Save(Request Request)
        {
            using (var scope = new TransactionScope())
            {
                Request.Save(request);
                // Call to other DALCFacade methods that insert data in different tables
                // OtherObject.Save(otherobject)
                scope.Complete();
            }
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:36:52+00:00Added an answer on June 3, 2026 at 2:36 pm

    Yes in the same thread, EF will properly consider transaction scope if it exists. EF will not create new transaction if it’s already in one.

    However, you must be careful because if you query your database without transaction then you will get dirty reads. Because EF will not read anything in transaction if it does not exist but it creates new transaction if it does not exist while saving changes.

    In your code you are only saving changes in transaction but you should be careful while reading and you should encapsulate your queries also in scope in smaller units.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question that can I use AS400ConnectionPool in Spring if then pls
I am trying to create a slider like this example. pls anyone help me.
using Microsoft.SqlServer.Management.SqlStudio.Explorer; unable to find this pls assist [update] found the dll's in this
This has been driving me mad someone help coz i don't seem to see
This is my first run through with PL SQL so I might be making
Pls. see Creating a Subversion branch . I created a repository with a URL
This seems really simple, and I see a lot of documentation about it, but
Pls check code .html form gets submitted even if javascript returns false. <form id=form1
Pls look at following code <select name=VideoType id=VideoType style=width:60px> <option value=All>All</option> <option value=Movie>Movie</option> <option
pls help me how to create a .htaccess file as index.php?regional=aaa domain.com/aaa/ list.php?regional=aaa&ctg=bbb&orderby=ccc&page=123 domain.com/list/aaa/bbb/ccc/123/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.