Link to home
Start Free TrialLog in
Avatar of scm0sml
scm0sml

asked on

good use of my unit of work?

Hi,

I have the following page load method:
 
protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            using (var db = new PublicUnitOfWork())
            {                
                DisplayPageCMS(litPageTitle, litMetaKeywords, litMetaDescription, litBodyText, db);
            }
        }
    }

Open in new window


It calls the following method in my base class:
public void DisplayPageCMS(Literal litPageTitle,Literal litMetaKeywords ,Literal litMetaDescription,Literal litBodyText, PublicUnitOfWork db)
    {
        Page p = db.Pages.FindById(1);

        //do some work to set the lit values of my meta tags etc
    }

Open in new window


I'm just wondering is the best way to use my PublicUnitOfWork or should the base class function be creating its own.

Note in my page load I may want to use the publicunitofwork some more for other things...

I'd appreciate some input/feedback on this.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial